add pwa support

This commit is contained in:
2022-12-06 14:59:34 +01:00
parent 2b40b2d0ab
commit 41e6e58128
16 changed files with 142 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { NgModule, isDevMode } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
@@ -8,6 +8,7 @@ import { MainViewComponent } from './main-view/main-view.component';
import { MaterialModule } from './material.module';
import { LoginPageComponent } from './components/login-page/login-page.component';
import { HttpClientModule } from '@angular/common/http';
import { ServiceWorkerModule } from '@angular/service-worker';
@NgModule({
@@ -21,7 +22,13 @@ import { HttpClientModule } from '@angular/common/http';
AppRoutingModule,
BrowserAnimationsModule,
MaterialModule,
HttpClientModule
HttpClientModule,
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: !isDevMode(),
// Register the ServiceWorker as soon as the application is stable
// or after 30 seconds (whichever comes first).
registrationStrategy: 'registerWhenStable:30000'
})
],
providers: [],
bootstrap: [AppComponent]