I need to set the [queryParams]
for a routerLink
by means of a component property, that is
@Component({
...
template: '<a [routerLink]="..." [queryParams]="queryParams | async">...</a>
...
})
export class MyComponent {
...
queryParams: any;
...
constructor(route: ActivatedRoute) {
this.queryParams = route.queryParams;
...
}
}
But that approach doesn't work, there are no query params appended to the route. What am I missing?