Reputation: 370
showBio(id) {
this.router.navigate(['/speakers', {outlets: {'bio': [id]}}]);
}
How can I write it in [routerLink] and still can pass an id? I am following this example for reference: Example
Upvotes: 3
Views: 4527
Reputation: 14077
The route syntax stays the same with [routerLink]
:
<a [routerLink]="['/speakers', {outlets: {'bio': [id]}}]">Link</a>
For this to work, the id
property needs to be exposed to your template.
Upvotes: 2