routerLink with params is not working
<a routerLink="/post?id=1">
Link
</a>
I want to navigate in other links with params using routerLink
routerLink with params is not working
<a routerLink="/post?id=1">
Link
</a>
I want to navigate in other links with params using routerLink
Use [queryParams]
in adition to routerLink
as explained in this post How to pass query parameters with a routerLink
In your particular example you'd do the following routerLink:
<a [routerLink]="['/post']" [queryParams]="{id: '1'}" queryParamsHandling="preserve"> Link
</a>
id can be variable as well.