我的Angular 5项目中有以下路由器配置:
{
path: 'foo',
component: FooComponent,
children: [
{
path: ':barId',
component: BarComponent,
children: [
{
path: '',
redirectTo: 'baz',
pathMatch: 'full'
},
{
path: 'baz',
component: BazComponent,
children: [
{
path: '',
redirectTo: '', // Need to redirect to (qux:0)
pathMatch: 'full'
},
{
path: '0',
outlet: 'qux',
component: QuxComponent
}
]
}
]
}
]
}
我想要做的是配置路由器,以便当用户输入/foo/:barId/baz
时,它会被重定向到/foo/:barId/baz/(qux:0)
。
是否可以在路由器配置中执行此操作?