mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-16 06:06:18 -08:00
feat: add pwa support
This commit is contained in:
1 parent
db0df76e53
commit
5a5085dcf7
14 files changed
+275
-263
No files matched your search
@@ -20,6 +20,7 @@ import { DataService } from './services/data.service';
|
||||
import { NgxIndexedDBModule, NgxIndexedDBService } from 'ngx-indexed-db';
|
||||
import { AppConfig } from '../environments/environment';
|
||||
import { dbConfig } from './indexed-db.config';
|
||||
import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
|
||||
// AoT requires an exported function for factories
|
||||
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
||||
@@ -65,6 +66,12 @@ export function DataFactory(dbService: NgxIndexedDBService, http: HttpClient) {
|
||||
deps: [HttpClient],
|
||||
},
|
||||
}),
|
||||
ServiceWorkerModule.register('ngsw-worker.js', {
|
||||
enabled: AppConfig.production,
|
||||
// Register the ServiceWorker as soon as the app is stable
|
||||
// or after 30 seconds (whichever comes first).
|
||||
registrationStrategy: 'registerWhenStable:30000',
|
||||
}),
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user