I'm trying to pass an id in my routerLink, how could I concatenate it?
<a routerLink="['/details', {{data.id}}]"> </a> doesnt work.
Do you have solutions?
Thanks in advance
I'm trying to pass an id in my routerLink, how could I concatenate it?
<a routerLink="['/details', {{data.id}}]"> </a> doesnt work.
Do you have solutions?
Thanks in advance
There you go.
<a [routerLink]="['/details', data.id]"> Link </a>
Parameters go as second item in the array syntax to router link, like this:
[routerLink]="['/details', data.id]
Read more here
Similar to above, but you can also do this:
<a [routerLink]="['/details' + data.id]"> Link </a>
© 2022 - 2024 — McMap. All rights reserved.
{{ }}
) in what you have now. You just needdata.id
after the route name. That should work. – Jenn