Angular 错误:无法匹配任何路由:';球员简介;userID=2';
我有以下模板表达式:Angular 错误:无法匹配任何路由:';球员简介;userID=2';,angular,Angular,我有以下模板表达式: [routerLink]="['player-profile',{userID:activity.user.id}]" 以及app.routing.ts中的以下定义: {path:'player-profile/:userID', component: PlayerProfileComponent}, 为什么单击routerLink会返回以下错误: Error: Cannot match any routes: 'player-profile;userID=2'
[routerLink]="['player-profile',{userID:activity.user.id}]"
以及app.routing.ts中的以下定义:
{path:'player-profile/:userID', component: PlayerProfileComponent},
为什么单击routerLink会返回以下错误:
Error: Cannot match any routes: 'player-profile;userID=2'
?
Angular 2 RC.5+新路由器只需使用
[routerLink]="['player-profile', activity.user.id]"
该对象用于查询参数。对于路线参数,位置非常重要。不需要传名字