我的Angular2路线有以下配置...
RouterModule.forRoot([
{
path: '',
// redirectTo: '/admin',
component: LoginComponent,
pathMatch: 'full'
},
{
path: "admin",
component: ContentComponent,
children: [
{
path:"admin",
component: HeaderComponent,
outlet: 'header'
},
{
path:"admin",
component: LeftNavComponent,
outlet: 'header'
},
{
path:"admin",
component: AdminComponent,
outlet: 'body'
}
]
}
])
这很好,但我真的不需要孩子的路径和导航(["/admin", {outlets: {"header":["admin"], "body":["admin"], "leftNav":["admin"]}}];
)和网址(#/admin/(header:admin//body:admin//leftNav:admin)
)真的很长。既然我可以推断孩子们有没有办法让他们离开?
答案 0 :(得分:0)
当我从@ angular / router v3.1.2升级到v3.2.0时,它开始按照我的预期工作。