Add routing modules - morpheus

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
adrenaline_junkie
Posts: 6
Joined: 21 Jan 2017, 15:30

10 Feb 2018, 00:30

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

adrenaline_junkie
Posts: 6
Joined: 21 Jan 2017, 15:30

13 Feb 2018, 02:20

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.

kubrasulukan
Posts: 87
Joined: 10 Jan 2018, 16:04

14 Feb 2018, 09:30

Glad to hear!

Regards

Post Reply

Return to “Morpheus - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests