Skip to content

Instantly share code, notes, and snippets.

@alxhub
Last active April 6, 2022 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alxhub/cb81d0b117430393a7c3e2dfc70ac4d6 to your computer and use it in GitHub Desktop.
Save alxhub/cb81d0b117430393a7c3e2dfc70ac4d6 to your computer and use it in GitHub Desktop.
// In a separate `lazy.routing.ts` file:
@NgModule({
imports: [
LazyPageModule,
  RouterModule.forChild([
  {path: '', pathMatch: 'full', component: LazyPageComponent},
  ]),
],
})
export class LazyPageRoutingModule {}
// Then, in the main application routing configuration:
export const ROUTES: Route[] = [
  /* ...other routes */
 {
path: 'lazy',
loadChildren: () => import('./lazy.routing').then(mod => mod.LazyPageRoutingModule),
},
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment