Add service worker to application startup
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
APP_INITIALIZER,
|
||||
ApplicationConfig,
|
||||
isDevMode,
|
||||
provideExperimentalZonelessChangeDetection,
|
||||
} from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
@@ -10,6 +11,7 @@ import {
|
||||
MatIconRegistry,
|
||||
} from '@angular/material/icon';
|
||||
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
||||
import { provideServiceWorker } from '@angular/service-worker';
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
import json from 'highlight.js/lib/languages/json';
|
||||
import { provideMonacoEditor } from 'ngx-monaco-editor-v2';
|
||||
@@ -43,5 +45,9 @@ export const appConfig: ApplicationConfig = {
|
||||
useValue: { fontSet: 'material-symbols-rounded' },
|
||||
},
|
||||
provideMonacoEditor(),
|
||||
provideServiceWorker('ngsw-worker.js', {
|
||||
enabled: !isDevMode(),
|
||||
registrationStrategy: 'registerWhenStable:30000',
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user