Ich habe die folgende Struktur:Angular2 wie zu einem faul geladenen Modul zu verweisen?
+--AppModule
| +--OverviewModule
| | +--OtherModule1
| | +--OtherModule2
| | +--OtherModule3
ich faul-Laden verwenden zu laden OverviewModule. Das ist mein AppModule Route config:
const appRoutes: Routes = [
{
path: 'overview',
loadChildren: 'app/injus/views/overview.module#OverviewModule'
},
{
path: '',
redirectTo: 'overview',
pathMatch: 'full'
},
{
path: '**',
component: PageNotFoundComponent
}
];
Wenn der Pfad 'overview'
es zeigt meine Übersicht Modul. Wenn der Pfad ''
ist, möchte ich, dass er auf 'Übersicht' geht. Leider wird das nicht funktionieren.
Übersicht Routing:
export const overviewRoutes: Routes = [
{
path: '',
component: OverviewComponent,
children: [
{
path: '',
redirectTo: 'othermodule1',
pathMatch: 'full'
},
{
path: 'othermodule1',
loadChildren: 'app/injus/views/othermodule1/othermodule1.module#otherModule1'
},
{
path: 'othermodule2',
loadChildren: 'app/injus/views/othermodule2/othermodule2.module#2otherModule1'
},
{
path: 'othermodule3',
loadChildren: 'app/injus/views/othermodule2/othermodule3.module#3otherModule1'
}
]
}
];
Wie kann ich zu einem faulen geladenen Modul direkt?
Haben Sie eine ' Router-Steckdose>' in der OverviewComponent? –
Ja, ich habe eine Router-Steckdose –