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