Angular route using query params

We can add query params in url simply by following simple rule.

<a [routerLink]="['product-list']" [queryParams]="{ page: 99 }">Go to Page 99</a>

With typescript we can do the same as below.

this.router.navigate(['/product-list'], { queryParams: { page: pageNum } });

Leave a Reply

Your email address will not be published.