Pass a parameter to routerLink in Angular

[routerLink]="['/user', user.id]"
[routerLink]="['user', user.id, 'details']"

To do so in a controller, you can inject Router and use:

router.navigate(['user', user.id, 'details']);

References
https://stackoverflow.com/questions/38062702/how-to-pass-a-parameter-to-routerlink-that-is-somewhere-inside-the-url

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.