如何在angularjs嵌套子路线2
问题描述:
完成路由两个孩子的,但我想说明嵌套的路线为那些孩子的如何在angularjs嵌套子路线2
例如:
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}
]
},
]},
检查[this](https://coryrylan.com/blog/introduction-to-angular-routing)或[this](http://blog.angular-university.io/angular2-router/) – sTx
嗨。 ,我改变了这个问题 –
下游'children:[{path ..,children:[{path,component}]}]''等等原理是一样的 – sTx