角度2/4路由与命名插座?

时间:2017-09-11 12:45:47

标签: angular angular2-routing

我正在尝试在我的应用中使用名为outlet的工具。

这是我的路线配置:

    {
    path: 'contact',
    children: [
      { path: '', component: ContactComponent, pathMatch: 'full' },
      { path: 'list', component: ContactlistComponent },
      { path: 'hold', component: ContactOperationComponent, outlet: 'popup' }      
    ]
  }

以下是我在AppComponent中使用主router-outlet

保存的插座
<router-outlet name="popup"></router-outlet>

这是我的routerLink,它正在调用我的Component

<a [routerLink]="['/contact',{outlets:{popup:['hold']}}]">Hold</a>

但是,这种方法生成的URL是一团糟。这看起来像这样:

/contact/(list//popup:hold)

应该是这样的

/contact/list(popup:hold)

由于我甚至无法访问被调用Component的参数。

这里有什么问题?

0 个答案:

没有答案