【发布时间】:2017-01-20 02:50:04
【问题描述】:
我正在使用新的 route3,想知道为子路由指定辅助组件的 URL 语法是什么。
我有以下子路由定义:
const router: RouterConfig = [
{
path: 'component-c', component: ComponentC, children: [
{ path: 'auxPath', component: ComponentAux, outlet: 'aux'},
{ path: 'c1', component: ComponentC1 }
]
}
];
而ComponentC的模板是这样的
@Component({
selector: 'component-c',
template: `
<div>Child Route Component</div>
<router-outlet></router-outlet>
<router-outlet name="aux"></router-outlet>
`,
directives: [ROUTER_DIRECTIVES]
})
URL /component-c/c1 显示 ComponentC1;但是,我尝试了许多组合,例如 /component-c(aux:auxPath)/c1、/component-c/c1(aux: auxPath) 等,但仍然无法弄清楚如何让 ComponentAux 显示出来......
【问题讨论】:
标签: angular angular2-routing angular2-router3