在我的app.module.ts中,我有导航栏的路线
RouterModule.forRoot([
{path:'home',component:HomeComponent},
{path:'angular5',component:Angular5MainComponent},
{path:'',redirectTo:'home', pathMatch:'full'},
{path:'**', component:HomeComponent}
]),
我有这个路由器插座标签。 在打开其中一个页面时,我可以选择侧面导航栏,其中包含许多选项。所以我为它创建了一个名为angular5.module.ts
的模块 RouterModule.forChild([
{path:'HistoryOfAngular', component: HistoryOfAngular}
])
我也有一个路由器插座标签。但它不起作用
答案 0 :(得分:0)
像这样创建你的数组并仅使用
this