I think preserveQueryParams not intended to add / update queryParams on behalf of the application.
You need to write your own logic to get the existing query parameters and update it according to your requirement, and then skip during navigation.
this.route.queryParams.subscribe(qparams => { this.currentQueryParams= qparams; }); updatedqueryParams = // use this.currentQueryParams update it to append\update new stuff let navigationExtras: NavigationExtras = { queryParams: updatedqueryParams }; // Navigate to the login page with extras this.router.navigate(['<some path>'], navigationExtras);
for preserveQueryParams designed to pass the current global Params requests you are heading to
therefore, if the current URL
dashboard?debug=true&somevar=1
and you write something like below
this.router.navigate(['admin'], { preserveQueryParams: true } );
there will be a new route, so it saves the request parameters.
admin?debug=true&somevar=1
Hope this helps!
source share