【发布时间】:2019-03-22 02:18:33
【问题描述】:
我有两个链接:
['/productlist',1000]['/productlist',1001]
这两个链接在同一个页面上。如果我第一次点击任何链接。它正在重定向到页面,但是如果我单击另一个链接,它就不起作用了。
component.html 代码
<a class="dropdown-item" (click)="GetProductList(subitem.SubCategoryID)">
<i class="mdi mdi-chevron-right" aria-hidden="true"></i>
{{ subitem.SubCategoryName}}
</a>
GetProductList(SubCategoryID){
this.router.navigate(['/productlist',SubCategoryID]);
}
【问题讨论】:
-
请分享您的代码。
-
component.html 代码 {{ subitem.SubCategoryName}} GetProductList(SubCategoryID){ this.router.navigate(['/productlist',SubCategoryID]); } 我正在为链接动态绑定值
-
请将该代码添加到问题中。
-
编辑帖子并添加代码。
标签: angular angular6 angular-components