feat: add pwa support

This commit is contained in:
2025-12-24 13:29:46 -03:00
parent 2384cfd307
commit 0f0fa78caa
15 changed files with 120 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ import {
ApplicationConfig,
InjectionToken,
provideBrowserGlobalErrorListeners,
provideZoneChangeDetection,
provideZoneChangeDetection, isDevMode,
} from '@angular/core';
import { provideRouter } from '@angular/router';
@@ -10,6 +10,7 @@ import { routes } from './app.routes';
import { strings } from './strings';
import { provideHttpClient } from '@angular/common/http';
import { Language } from './types/Language.type';
import { provideServiceWorker } from '@angular/service-worker';
const STRINGS_TOKEN = 'strings';
export const STRINGS_INJECTOR = new InjectionToken<typeof strings>(STRINGS_TOKEN);
@@ -24,6 +25,9 @@ export const appConfig: ApplicationConfig = {
provideRouter(routes),
provideHttpClient(),
{ provide: STRINGS_INJECTOR, useValue: strings },
{ provide: LS_LANGUAGE, useValue: 'language' },
{ provide: LS_LANGUAGE, useValue: 'language' }, provideServiceWorker('ngsw-worker.js', {
enabled: !isDevMode(),
registrationStrategy: 'registerWhenStable:30000'
}),
],
};