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 } });
Categorized as Angular

By Santosh Kumar Shah

I am JavaScript developer.

Leave a comment

Your email address will not be published. Required fields are marked *