1
  1. How can I have routerLink link to both main router-outlet and secondary (sidebar) router-outlet?

I have:

<a [routerLink]="['', {outlets: {sidebar: 'filters' }}]">FILTERS</a>
<a [routerLink]="['home']">HOME</a>

When I am trying to combine this into one link:

<a [routerLink]="['home', {outlets: {sidebar: 'filters' }}]">HOME</a>

it's poining to /home/(sidebar:filters) - which is broken link.

Here is my Stackblitz.

  1. Is there any way to have two route-outlets load their components with one link without having this ugly url? I tried this approach: https://stackoverflow.com/a/42204114/1351452, but it does not seem to be working.

  2. Maybe for sidebar tied to specific route (or set of routes) should I use ngIf directive, that I would compare to route to chose right component?

Filip Witkowski
  • 795
  • 3
  • 14
  • 24

0 Answers0