使用路由参数构建Angular 2 RC路由器链接的问题



我参考了Angular 2关于RC路由器的文档路由参数

以下是文档中提到的关于使用路由参数构建路由器链路的内容:

['HeroDetail', { id: hero.id }] // {id: 15}

这应该产生以下链接:

localhost:3000/hero/15

我有以下链接:

<a [routerLink]="['/dashboard/messageconversation/', {otherId: getOther(message).id}]">

并且它生成以下链接(注意分号以及查询参数,而不是路由参数

http://localhost:8080/dashboard/messageconversation;otherId=2

以下是@Routes的定义:

{path: '/messageconversation/:otherId', component: MessageConversationComponent}

有人能告诉我我做错了什么吗?

添加路由参数(与查询参数

<a [routerLink]="['/dashboard/messageconversation', getOther(message).id]">

感谢特技狒狒指导我到相关的岗位

最新更新