feat: add pwa support
This commit is contained in:
@@ -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'
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user