For example I am on route /cars?type=coupe and I want to navigate to the same endpoint with additional query params (but keeping existing one). I am trying some
/cars?type=coupe
In Angular 4+, preserveQueryParams have been deprecated in favor of queryParamsHandling. The options are either 'merge' or 'preserve'.
preserveQueryParams
queryParamsHandling
'merge'
'preserve'
In-code example (used in NavigationExtras):
NavigationExtras
this.router.navigate(['somewhere'], { queryParamsHandling: "preserve" });
In-template example: