-
Notifications
You must be signed in to change notification settings - Fork 46
Lazy loading module
If you login to AngularAndSpring you can open the orderbooks route to see the current orders in the exchanges. The route to that component is put in a lazy loading module because it is not needed before you login. It is loaded on demand. With this feature big applications can be split in smaller parts to get the initial load times down.
The orderbooks route is set in the app-routing.module.ts like this:
...
{path: 'orderbooks', loadChildren: './orderbooks/orderbooks.module#OrderbooksModule', canActivate: [AuthGuardService]}
...
@NgModule({
RouterModule.forRoot(routes)
...
The orderbooks module is set in the orderbooks.module.ts. It imports the needed modules and declares the Orderbooks component.
The orderbooks module routing is set in the orderbooks-routing.module.ts. It configures the route to the component and sets it with:
...
@NgModule({
RouterModule.forChild(routes)
...