I am trying to make a link set a query string param in the url...
In my view, I am doing:
<a (click)="selectPage(123)">123</a>
and in my component:
selectPage(page: number) {
this.router.navigate([], { relativeTo: this.route, queryParams: { 'page': page}, queryParamsHandling: 'merge', skipLocationChange: true});
}
I click the link, the selectPage function fires, but the url in the browser does not have a page parameter show up..
CodePudding user response:
You have to omit skipLocationChange
property, then it would work.