我正在尝试使用routerLink加载父 - >子 - >子路由器插座的页面,其中包含两个命名插座 .
http://localhost:4200/#/output/(output:details/(data:distributions))
1)如果我将URL粘贴到浏览器中就可以了
2)如果我使用以下它工作:
this.router.navigateByUrl('output/(output:details/(data:distributions))');
如果我尝试在angular2选项卡组件中使用路由器链接,则它不起作用
[routerLink]="['/output', {outlets: {'output': ['details'],'data':['distributions']}}]"
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'output'
我的其他只有父 - >孩子的链接可以工作:
[routerLink]="['/output', {outlets: {'output': ['scenarios']}}]"
我必须假设我为parent-> child-> child格式化routerLink不正确 .
1 回答
你可以这样做: