angular2 routing - Issue with building an Angular 2 RC router link with a route parameter -
i in reference angular 2 documentation rc router route parameters:
here mentioned in documentation constructing router link route parameter:
['herodetail', { id: hero.id }] // {id: 15}
this supposed produce following link:
localhost:3000/hero/15
i have following link:
<a [routerlink]="['/dashboard/messageconversation/', {otherid: getother(message).id}]">
and produces following link (notice semicolon query parameter instead of route parameter):
http://localhost:8080/dashboard/messageconversation;otherid=2
here @routes
definition:
{path: '/messageconversation/:otherid', component: messageconversationcomponent}
can please tell me getting wrong?
it turns out proper way add route parameter (as opposed query parameter) pass parameter second element of array follows:
<a [routerlink]="['/dashboard/messageconversation', getother(message).id]">
credits go stuntbaboon directing me relevant post.
Comments
Post a Comment