how to change data if queryparam valu change angular code example
Example 1: angular set query params
constructor(private router: Router) { }
public myMethodChangingQueryParams() {
const queryParams: Params = { myParam: 'myNewValue' };
this.router.navigate(
[],
{
relativeTo: activatedRoute,
queryParams: queryParams,
queryParamsHandling: 'merge',
});
}
Example 2: angular set url parameters
<a href="javascript:;" routerLink="/link/params">
My link
</a>
{path: '/link/:paramsName', component: MyComponent }