This question is not the same as this one.
I need to know how to remove the hash from from the url and also update the url in the browser.
@NgModule({
imports: [RouterModule.forRoot(routes, { anchorScrolling: 'enabled', useHash: false, scrollPositionRestoration:'enabled' })],
"@angular/router": "~9.1.2",
Current behavior:
Url in browser: /something
User clicks: <a [routerLink]="['/home']" fragment="home" >Home</a>
Browser navigates to: /home
Url in browser: /home#home
Page scrolls to: #home
Behavior when using answer to question cited above:
Url in browser: /something
User clicks: <a [routerLink]="['/home']" fragment="home" skipLocationChange>Home</a>
Browser navigates to: /home
Url in browser: /something
Page scrolls to: #home
Desired behavior:
Url in browser: /something
User clicks: <a [routerLink]="['/home']" fragment="home" >Home</a>
Browser navigates to: /home
Url in browser: /home // desired behavior is that current url is shown in browser without hash.
Page scrolls to: #home