Centralize segments declaration with Lazy Loading feature


I adopted lazy loading but I don’t want to specify segments in each page file. I would prefer to centralize them in app.module.ts as before with:

	links: [ { component: 'HomePage', name: 'Home', segment: 'home' } ]

But by doing that I have this error: “Uncaught (in promise): Error: No component factory found for HomePage. Did you add it to @NgModule.entryComponents?”

Do you know if it’s possible? May I did something wrong?


You forget include the component in the app.module.ts.
include the component in @NgModule({
declarations: [

But if I do that in my app.module.ts, it’s no longer lazy loading :confused:

UP ! (otherwise I will post on github but I don’t think it’s the best place to ask)

Still looking for an answer please… @jgw9617 @mhartington