Michael Cohen
Michael Cohen

Reputation: 11

Angular 2, Error: Cannot match any routes using named router outlet and [routerLink] inside of named outlet

I have a minimal Plnkr here: Named Router Outlet Example

This link works outside of the router, but the same link fails if it is inside of a component inside of the named router outlet:

<a [routerLink]="[{ outlets: { taco: ['al-pastor']} }]">Al Pastor</a>

Calling a function on the component that calls the following works:

this.router.navigate([{ outlets: { taco: 'al-pastor' }}]);

But I would rather use [routerLink]

Is it possible to use [routerLink] to target the current named router outlet?

Upvotes: 1

Views: 160

Answers (0)

Related Questions