When navigating and updating settings in my app, I am utilizing query parameters that I need to retain and update. Adding a parameter is simple using the following method.
onNavigate() {
this.router.navigate(['reports'], {queryParams: {'report': this.chart}, preserveQueryParams:true});
}
However, the issue arises when I try to change the report parameter and append new parameters to the URL throughout the application.
By using preserveQueryParams: true
, my parameters become read-only. I am looking for a way to update existing parameters and add new ones without losing any unless they are intentionally cleared.
Is there a way to achieve this without losing the current set parameters?