我想路由到此页面传递一个参数:http://localhost:4200/inventory/client?id=2
我的工作是:
this.router.navigate(['/inventory/client',{id:this.vendorId}]);
答案 0 :(得分:1)
试试这个:
this.router.navigate(['/inventory/client'], { queryParams: { id: this.vendorId} });
答案 1 :(得分:0)
您应该使用 queryParams
this.router.navigate(['/inventory/client'], { queryParams: { id: this.vendorId} });
答案 2 :(得分:0)
this.router.navigate(['/inventory/client',
queryParams :
{
id : (this.vendorId ? this.vendorId : '')
}
]);