带参数的角度辅助路由器未定义

时间:2020-02-05 10:56:03

标签: angular routing routerlink angular-routerlink angular-auxiliary-routes

我有一个表单(A)组件,可以使用按钮导航到另一个组件中的另一个表单(B)。现在,该应用程序还具有一个侧栏,该侧栏应该具有到两个表单组件的链接。表单A已预先填充,并使用id进行检索。 现在,当我尝试将路由器链接添加到辅助路由器链接的侧栏中时,它说链接未定义(/ undefined)。下面是代码。

{path:'a/:id' , component: AComponent }, 
{path:'b/:id' , component: BComponent },    
{ path: 'a/:id',component: AComponent,outlet: "sidebar" }

我使用过的HTML中的routerlink是 [routerLink]="[{outlets:{'sidebar':['/a',data.id]}}]"-显示未定义

对于[routerLink]="['/b',data.id]有效的按钮

0 个答案:

没有答案