I am having issues adding modules and using routing modules to better segment the architecture. For this example, I am creating login and forgot password pages and would like them contained in their own module.
I issue the following commands
ng g m /routes/account --routing which gives me an account module and its associated routing module
next i gen the components
ng g c /routes/account/login and ng g c /routes/account/forgot-password
this all works as expected. My trouble is getting the morpheus template to use the routes in the routing modules.
Can someone point me in the right direction?
The base template has all the routes in app.routes.ts. I need to be able to specify the routes in the routing modules for each section for easier LTS
Add routing modules - morpheus
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 6
- Joined: 21 Jan 2017, 15:30
As it turns out, what I was trying was correctly implemented, however the routing module that CLI created was angular 4 style. Changing the syntax for the export in the routing module from
export class [classname] {}
to
export const [constname]: ModuleWithProviders = RouterModule.forChild(routes);
fixed my issues.
export class [classname] {}
to
export const [constname]: ModuleWithProviders = RouterModule.forChild(routes);
fixed my issues.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests