Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/403.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
Javascript 如何通过单击运行函数导航到命名路由器出口?在角4?_Javascript_Angular - Fatal编程技术网

Javascript 如何通过单击运行函数导航到命名路由器出口?在角4?

Javascript 如何通过单击运行函数导航到命名路由器出口?在角4?,javascript,angular,Javascript,Angular,我使用此方法导航到命名路由器outlet=>(链接->[routerLink]=“[{outlets:{'dashboard':['userprofile']}}]&router oulet->),现在如何通过函数导航到此路由器?或者如何在“this.router.navigate”中使用outlet名称 路由到此-> <router-outlet name="dashboard"></router-outlet> 现在,我如何通过运行函数导航到仪表板路由器出口?使用

我使用此方法导航到命名路由器outlet=>(链接->[routerLink]=“[{outlets:{'dashboard':['userprofile']}}]&router oulet->),现在如何通过函数导航到此路由器?或者如何在“this.router.navigate”中使用outlet名称

路由到此->

<router-outlet name="dashboard"></router-outlet> 

现在,我如何通过运行函数导航到仪表板路由器出口?使用this.router.navigate?

它应该看起来或多或少像:

this.router.navigate([{outlets: {'dashboard':'userprofile'}}],{
  relativeTo: this.route
});

它应该看起来或多或少像:

this.router.navigate([{outlets: {'dashboard':'userprofile'}}],{
  relativeTo: this.route
});

显示错误->相对于不可分配给导航附加程序!this.router.navigate([{outlets:{'dashboard':'userprofile'},{relativeTo:this.route}]));->此语法不提供从何处导入路由的错误?路由是ActivatedRoute的注入实例,从@angular/routershows error->relative to导入不可分配给导航附加程序!this.router.navigate([{outlets:{'dashboard':'userprofile'},{relativeTo:this.route})->此语法没有给出从何处导入路由的错误?路由是ActivatedRoute的注入实例,从@angular/routernow导入,我使用了第二个名为“popup”的路由器出口“****在模式内,显示错误->**找不到要加载的插座弹出窗口**。。。?!我通过在小学下面写****解决了这个问题。。竖起大拇指!现在,我在一个模式中使用了第二个名为“popup”****的路由器出口,显示错误->**找不到要加载的出口pop**。。。?!我通过在小学下面写****解决了这个问题。。竖起大拇指!