pwa support

This commit is contained in:
Bastian Wagner
2026-02-18 14:02:45 +01:00
parent dd59a62e96
commit 0fd4967c44
15 changed files with 120 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { ApplicationConfig, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
import { ApplicationConfig, importProvidersFrom, provideZoneChangeDetection, isDevMode } from '@angular/core';
import { provideRouter } from '@angular/router';
import { provideHotToastConfig } from '@ngxpert/hot-toast';
@@ -6,6 +6,7 @@ import { routes } from './app.routes';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { tokenInterceptor } from './core/interceptor/token.interceptor';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { provideServiceWorker } from '@angular/service-worker';
export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideHttpClient(withInterceptors([tokenInterceptor]))
@@ -18,6 +19,9 @@ export const appConfig: ApplicationConfig = {
dismissible: false,
duration: 5000
}),
provideAnimationsAsync()
provideAnimationsAsync(), provideServiceWorker('ngsw-worker.js', {
enabled: !isDevMode(),
registrationStrategy: 'registerWhenStable:30000'
})
]
};