Skip to content

Instantly share code, notes, and snippets.

@AntonioCardenas
Created May 13, 2022 23:29
// En un archivo `lazy.routing.ts` separado:
@NgModule({
imports: [
LazyPageModule,
RouterModule.forChild([
{path: '', pathMatch: 'full', component: LazyPageComponent},
]),
],
})
export class LazyPageRoutingModule {}
// Luego, en la configuración de enrutamiento de la aplicación principal
export const ROUTES: Route[] = [
/* ...otras rutas */
{
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