I am struggling with cleaning URL parameters while navigating in Angular 2.4.2. I tried to set each parameter to clear the parameters in the navigation line below, or any mix in it using navigation or navigateByUrl, but I canβt figure out how to do this.
this.router.navigateByUrl(this.router.url, { queryParams: {}, preserveQueryParams: false });
As an example, I am on the route /section1/page1?key1=abc&key2=def and want to stay on the same route but delete all URL parameters, so the end result should be /section/page1
source share