service worker
This commit is contained in:
@@ -6,7 +6,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { HttpClientModule, HttpInterceptor, HttpHandler, HttpRequest, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { MaterialModule } from './material/material.module';
|
||||
import { QRCodeModule } from 'angularx-qrcode';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { MatPaginatorIntl } from '@angular/material/paginator';
|
||||
import { MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
@@ -37,6 +36,8 @@ import { UiPoints } from './ui/points/points.ui';
|
||||
import { ConfirmDialog } from './ui/confirm/confirm.component'
|
||||
|
||||
import { I18nService, I18nPaginatorIntl } from './services/i18n.service';
|
||||
import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
import { environment } from '../environments/environment';
|
||||
|
||||
|
||||
export function fetchI18n(i18n: I18nService) {
|
||||
@@ -99,7 +100,12 @@ export class XhrInterceptor implements HttpInterceptor {
|
||||
HttpClientModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
QRCodeModule,
|
||||
ServiceWorkerModule.register('ngsw-worker.js', {
|
||||
enabled: environment.production,
|
||||
// Register the ServiceWorker as soon as the app is stable
|
||||
// or after 30 seconds (whichever comes first).
|
||||
registrationStrategy: 'registerWhenStable:30000'
|
||||
}),
|
||||
],
|
||||
exports: [ MaterialModule ],
|
||||
providers: [ { provide: APP_INITIALIZER, useFactory: fetchI18n, deps: [ I18nService ], multi: true }, { provide: MAT_DATE_LOCALE, useFactory: setMaterialDate, deps: [ I18nService ], multi: true }, { provide: HTTP_INTERCEPTORS, useClass: XhrInterceptor, multi: true }, DatePipe,
|
||||
|
||||
Reference in New Issue
Block a user