gpt4 book ai didi

Angular 8 - 路由没有发生 - 垫表行

转载 作者:行者123 更新时间:2023-12-05 07:10:56 25 4
gpt4 key购买 nike

我不知道为什么点击行后我的路由没有发生。没有错误显示。URL 中的路径从“http://localhost:4200/vendor-list”更改为“http://localhost:4200/vendor-list/vendor”但是页面没有变化。

vendorlist.component.html

<tr mat-header-row *matHeaderRowDef="ordersDisplayedColumns"></tr>
<tr (click)="displayData(row)" mat-row *matRowDef="let row; columns: ordersDisplayedColumns;"></tr>
</table>

vendorlist.component.ts

displayData(row)
{
console.log(row);
this.router.navigate(["/vendor-list/vendor/"]);
}

myrouting.module.ts

{path:'vendor-list',component:VendorlistComponent,
children:[
{path:'vendor',component:VendorComponent,
]},

最佳答案

{path:'vendor-list',
children:[
{path:'vendor',component:VendorListComponent,canActivate:[AuthguardGuard]},
{path:'vendor',component:VendorComponent,canActivate:[AuthguardGuard]}

]}

请检查这个

关于Angular 8 - 路由没有发生 - 垫表行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61026133/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com