Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should be an equivalent [routerLink] code for this.router.navigate code?

   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

like image 721
Jayant Pareek Avatar asked Feb 18 '26 18:02

Jayant Pareek


1 Answers

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.

like image 76
AngularChef Avatar answered Feb 21 '26 15:02

AngularChef



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!