Page 1 of 1

Add routing modules - morpheus

Posted: 10 Feb 2018, 00:30
by adrenaline_junkie
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

Re: Add routing modules - morpheus

Posted: 13 Feb 2018, 02:20
by adrenaline_junkie
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] {}
export const [constname]: ModuleWithProviders = RouterModule.forChild(routes);

fixed my issues.

Re: Add routing modules - morpheus

Posted: 14 Feb 2018, 09:30
by kubrasulukan
Glad to hear!