如何在使用angular2中的参数的子路由的情况下使用redirectTo
。我的路由结构,这样对于子路由,在angular2中的redirectTo
const appRoutes: Routes = [
{ path: '', redirectTo : '/home', pathMatch: 'full'},
{ path: 'home', component: HomeComponent},
{ path: 'xyz/:id', component: XYZ },
{
path: 'abc/:id', component: ABC,
children: [
{ path: '', redirectTo : 'def', pathMatch: 'prefix' },
{ path: 'def/:id', component: DEF }
]
}
]
但它不工作
还,什么是路由pathMatch
?
对不起,但在我的情况下'ID'是不一样的;)现在该做什么? –