Centralize segments declaration with Lazy Loading feature


#1

Hi!

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?

Thanks


#2

You forget include the component in the app.module.ts.
include the component in @NgModule({
declarations: [
MyApp,
HomePage,
InicioPage
],


#3

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


#4

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


#5

Still looking for an answer please… @jgw9617 @mhartington