Using Angular Router, I want to navigate to another url without adding it to the browser history.
this.router.navigateByUrl(`${pathWithoutFragment}#${newFragment}`);
Can I do it with only Angular?
Thanks to NavigationExtras you can now use replaceUrl: boolean
inside navigate()
This will replace the current url, and the new URL will update in the address bar:
this.router.navigate([`/somewhere`], { replaceUrl: true });
That way when you press back it will not remember the previous page in the history.