Passing Angular Query Parameters Programmatically

Image by Rahul Yadav from Pixabay

Scenario

Approach

this.router.navigate(
['/cars'],
{ queryParams: { type: 'suv', color='silver' } });
}
<a [routerLink]="['/cars']" 
[queryParams]="{ type: 'suv', color='silver'}">
Cars
</a>