Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 是否有可能在次级出口角2中获得一级管线出口参数?_Angular_Angular2 Routing - Fatal编程技术网

Angular 是否有可能在次级出口角2中获得一级管线出口参数?

Angular 是否有可能在次级出口角2中获得一级管线出口参数?,angular,angular2-routing,Angular,Angular2 Routing,我一直在尝试使用route ActivatedRoute模块从命名路由获取辅助路由出口。e、 g 当前url:http://localhost:4200/dashboard/contraceptives/(评估:5991780301d88a211e86e012//详细信息:599062793f86454d43896255) 销售点: <div class="col m4 z-depth-3"> <router-outlet name="details"><

我一直在尝试使用route ActivatedRoute模块从命名路由获取辅助路由出口。e、 g

当前url:
http://localhost:4200/dashboard/contraceptives/(评估:5991780301d88a211e86e012//详细信息: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>

我设法找到了一种方法:

构造函数(路由器:路由器){
RouterLinks.events(事件=>{
//我在这里订阅这些活动
const primaryRouter=event.state.root.firstChild;
//其中第一个子节点是主路由器出口
})
}

您需要欢迎参加SO,请解释您的答案。不要只发布代码片段
 ngOnInit() {
    this.sub = this.route.params.subscribe(params => {
      this.id = params['id'];
    });
  }