From 19a0cc05c0e963ffa470a4a8ca26a06fe27e2178 Mon Sep 17 00:00:00 2001 From: Manuel Rauber Date: Thu, 21 Dec 2023 11:32:25 +0100 Subject: [PATCH] feat: use hash location --- src/app/app.config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 0da19c9..b2d5971 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,5 +1,5 @@ import { APP_INITIALIZER, ApplicationConfig } from '@angular/core'; -import { provideRouter, withInMemoryScrolling } from '@angular/router'; +import { provideRouter, withHashLocation, withInMemoryScrolling } from '@angular/router'; import { routes } from './app.routes'; import { flowbiteAppInitializer } from './flowbite'; import { provideAnimations } from '@angular/platform-browser/animations'; @@ -11,7 +11,11 @@ export const appConfig: ApplicationConfig = { providers: [ { provide: APP_INITIALIZER, useFactory: () => flowbiteAppInitializer, multi: true }, provideAnimations(), - provideRouter(routes, withInMemoryScrolling({ scrollPositionRestoration: 'top' })), + provideRouter( + routes, + withInMemoryScrolling({ scrollPositionRestoration: 'top' }), + withHashLocation(), // better compat with GitHub Pages + ), provideHttpClient(withFetch()), CharacterTable, { provide: DATABASE_TABLE, useExisting: CharacterTable, multi: true },