私は、次の構造を得た:私は遅延ロードを使用OverviewModuleロードするにAngular2遅延ロードされたモジュールに向ける方法は?
+--AppModule
| +--OverviewModule
| | +--OtherModule1
| | +--OtherModule2
| | +--OtherModule3
を。これは私のAppModuleルート設定です
const appRoutes: Routes = [
{
path: 'overview',
loadChildren: 'app/injus/views/overview.module#OverviewModule'
},
{
path: '',
redirectTo: 'overview',
pathMatch: 'full'
},
{
path: '**',
component: PageNotFoundComponent
}
];
パスが'overview'
の場合、私の概要モジュールが表示されます。パスが''
の場合、「概要」に移動します。残念ながら、これは動作しません。
概要ルーティング:
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'
}
]
}
];
どのように私は怠惰なロードされたモジュールに指示することができますか?
OverviewComponentに ' router-outlet>'がありますか? –
はいルータ出口があります –