0
我一直在尝试从使用路由ActivatedRoute模块的命名路由获得第二个路由出口。 e.g是否有可能在辅助出口Angular 2中获得主要路由出口参数?
当前网址:http://localhost:4200/dashboard/contraceptives/(assessment:5991780301d88a211e86e012//details:599062793f86454d43896255)
网点:
<div class="col m4 z-depth-3">
<router-outlet name="details"></router-outlet>
</div>
<div class="col m4 z-depth-3">
<router-outlet name="assessment"></router-outlet>
</div>
组件:
我怎样才能在当前的出口和组件的细节PARAMS?
ngOnInit() {
this.sub = this.route.params.subscribe(params => {
this.id = params['id'];
});
}
需要[穿越激活途径(https://angular.io/api/router/ActivatedRoute#parent) –