I want to replace or update the second param of a URL.
My URL is this way edit/id/test-page/id2. I want to replace/update the value of id2 when a button is clicked. I tried the following but few of them are adding new query params to the existing URL, and one example was appending the value to id param.
-
this.activatedoute.navigate([ this.route.url ], { queryParams: {id: this.id1, id2: this.id2} })
-
this.activatedoute.navigateByUrl(this.route.url);
Any help is appreciated