From d31d69989a22b7a3398e649a9db9586d909ecd4a Mon Sep 17 00:00:00 2001 From: Justin McLellan Date: Sat, 17 Jun 2023 08:33:36 -0500 Subject: [PATCH] remove hash routing and enable anchor scrolling --- src/main.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 56918a4..91c4965 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,7 +3,6 @@ import { environment } from './environments/environment'; import { bootstrapApplication } from '@angular/platform-browser'; import { AppComponent } from './app/app.component'; import { APP_ROUTES } from './app/app.routes'; -import { LocationStrategy, HashLocationStrategy } from '@angular/common'; import { RouterModule } from '@angular/router'; import { provideAnimations } from '@angular/platform-browser/animations' import { HttpClientModule } from '@angular/common/http'; @@ -14,8 +13,10 @@ if (environment.production) { bootstrapApplication(AppComponent, { providers: [ - importProvidersFrom(RouterModule.forRoot(APP_ROUTES), HttpClientModule), - provideAnimations(), - { provide: LocationStrategy, useClass: HashLocationStrategy }, + importProvidersFrom(RouterModule.forRoot(APP_ROUTES, { + scrollPositionRestoration: 'enabled', + anchorScrolling: 'enabled' + }), HttpClientModule), + provideAnimations() ], }).catch((err) => console.error(err));