I'm trying to set up Angular (8) with lazy loading, but I just can't figure out how to make it work.
I have 3 modules, each others having different sub-routes :
- module1 (inside of my app)
- /home
- /home/path1
- /home/path2
- module2 (presentation of the app, public)
- index
- presentation
- features...
- module3 (everything related to access)
- login
- register
Anyone would have a working example on how to make this function properly ?
Thanks
EDIT = here's the routing code of my main module :
{ path: 'home', component: HomeComponent, canActivate: [AuthGuardService], children: [ { path: '', component: DashboardComponent, canActivate: [AuthGuardService] }, { path: 'upgrade', component: StripeFormComponent, canActivate: [AuthGuardService] } ] }, ];
I tried to add lazy loading in the app-routing.module.ts. I reloaded my app, and looked like there was a bit less code, and my module looked like it was loaded lazily however when I tried to access the page, I got a blank page with no explanation. So I'm lost.