Angular 2中具有命名路由出口的URL不正确

时间:2017-02-14 13:50:28

标签: javascript angular typescript routing

我正在编写以下代码用于路由:

imports: [
    RouterModule.forChild([{
    path: 'list/open',
    component: SWAOrderAppComponent,
    children: []
  }, {
      path: 'list/:orderId',
      component: SWAOrderPackageComponent,
      outlet: 'popup'
    }, {
    path: '',
    redirectTo: 'list',
    pathMatch: 'full',
  }])],
  exports: [RouterModule,]

并使用以下代码导航到路线" list / 911"使用指定的插座' popup'

this.router.navigate([{ outlets: { popup: "list/"+ id }}]);

这是加载正确的组件,但我正在使用此路由获取以下网址:

https://host/list(popup:list/911)

我想要格式的网址     https://host/list/911

0 个答案:

没有答案