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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -