我正在尝试在我的应用程序中实现命名出口。
这是我的路线配置:
{
path: 'contact',
children: [
{ path: '', component: ContactComponent, pathMatch: 'full' },
{ path: 'list', component: ContactlistComponent },
{ path: 'hold', component: ContactOperationComponent, outlet: 'popup' }
]
}
这是我一直保留的OutletAppComponent
与主要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
.
这里可能有什么问题?