I have some named <router-outlet>
which I can navigate to by url like so: (outletname:path)
.
I have been able to create a routerLink
like so:
<a [routerLink]="[{ outlets: { outletname : [child.attributes.href] } }]" routerLinkActive="active">{{child.attributes.text}}</a>
You can see that I've had to provide outletname
in [routerLink]
. What I would like is to provide the outlet name by a variable. I'm trying to iterate over a collection of child routes that may use different named <router-outlet>
.
So is there away to provide the outletname via a variable like so ..?
<a [routerLink]="['wordpress/',{ outlets: { OUTLET_NAME_AS_VAR : [child.attributes.href] } }]" routerLinkActive="active">{{child.attributes.text}}</a>