Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 错误:无法匹配任何路由:';球员简介;userID=2';_Angular - Fatal编程技术网

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]"
该对象用于查询参数。对于路线参数,位置非常重要。不需要传名字