Javascript 如何在angularjs 2中嵌套子路由
已完成两个孩子的路由,但我想显示这些孩子的嵌套路由 例如:Javascript 如何在angularjs 2中嵌套子路由,javascript,angularjs,angular,Javascript,Angularjs,Angular,已完成两个孩子的路由,但我想显示这些孩子的嵌套路由 例如: home child1 child2 | grand child | grand child(1) 路线代码 { path: 'faqmain', component: FaqmainComponent, children: [{path: 'chi
home child1 child2
|
grand child
|
grand child(1)
路线代码
{
path: 'faqmain',
component: FaqmainComponent,
children: [{path: 'child-one', component: ApplicationSecondComponent}]
}
你可以试试这样的
{ path:'', redirectTo:'home', pathMatch:'full'},
{ path:'home',component:HomeComponent},
{ path:'parent',component: ParentComponent,
children:[
{ path:'',redirectTo:'child',pathMatch:'full'},
{ path:'child',component:ChildComponent,
children:[
{ path:'',redirectTo:'subChild',pathMatch:'full'},
{ path:'subChild',component:SubChildComponent}
]
},
]},
你可以试试这样的
{ path:'', redirectTo:'home', pathMatch:'full'},
{ path:'home',component:HomeComponent},
{ path:'parent',component: ParentComponent,
children:[
{ path:'',redirectTo:'child',pathMatch:'full'},
{ path:'child',component:ChildComponent,
children:[
{ path:'',redirectTo:'subChild',pathMatch:'full'},
{ path:'subChild',component:SubChildComponent}
]
},
]},
检查或嗨,我更改了问题下游的相同原则<代码>子项:[{path..,子项:[{path,component}]}]等等检查或嗨,我更改了问题下游的相同原则<代码>子项:[{path..,子项:[{path,component}]}]等等