File tree Expand file tree Collapse file tree 4 files changed +11
-23
lines changed Expand file tree Collapse file tree 4 files changed +11
-23
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
2
2
import { BrowserModule } from '@angular/platform-browser' ;
3
3
import { APP_BASE_HREF } from '@angular/common' ;
4
4
import { HttpClientModule } from '@angular/common/http' ;
5
+ import { ServiceWorkerModule } from '@angular/service-worker' ;
5
6
import { AppComponent } from './app.component' ;
6
7
import { AppRoutingModule } from './app-routing.module' ;
7
8
@@ -15,7 +16,14 @@ import { CoreModule } from './core/core.module';
15
16
imports : [ BrowserModule , CoreModule ,
16
17
HttpClientModule , AppRoutingModule ,
17
18
AboutModule , HomeModule ,
18
- SharedModule . forRoot ( ) ] ,
19
+ SharedModule . forRoot ( ) ,
20
+ /**
21
+ * In order to start the Service Worker in Production located at "/ngsw-worker.js"
22
+ * uncomment this line. More about Service Workers here
23
+ * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
24
+ */
25
+ // ServiceWorkerModule.register('ngsw-worker.js', { enabled: String('<%= BUILD_TYPE %>') === 'prod' })
26
+ ] ,
19
27
declarations : [ AppComponent ] ,
20
28
providers : [ {
21
29
provide : APP_BASE_HREF ,
Original file line number Diff line number Diff line change @@ -11,13 +11,3 @@ enableProdMode();
11
11
12
12
platformBrowser ( ) . bootstrapModuleFactory ( AppModuleNgFactory ) ;
13
13
14
- // In order to start the Service Worker located at "/ngsw-worker.js"
15
- // uncomment this line. More about Service Workers here
16
- // https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
17
-
18
- // if ('serviceWorker' in navigator) {
19
- // (<any>navigator).serviceWorker
20
- // .register('/ngsw-worker.js')
21
- // .then((registration: any) => console.log('ServiceWorker registration successful with scope: ', registration.scope))
22
- // .catch((err: any) => console.log('ServiceWorker registration failed: ', err));
23
- // }
Original file line number Diff line number Diff line change @@ -21,15 +21,3 @@ if (String('<%= BUILD_TYPE %>') === 'prod') {
21
21
// const options: any = { providers };
22
22
platformBrowserDynamic ( ) . bootstrapModule ( AppModule /*, options*/ ) ;
23
23
// });
24
-
25
- // In order to start the Service Worker located at "/ngsw-worker.js"
26
- // uncomment this line. More about Service Workers here
27
- // https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
28
- //
29
- // if ('serviceWorker' in navigator) {
30
- // const workerScript = '/ngsw-worker.js';
31
- // (<any>navigator).serviceWorker
32
- // .register(workerScript)
33
- // .then((registration: any) => console.log('ServiceWorker registration successful with scope: ', registration.scope))
34
- // .catch((err: any) => console.log('ServiceWorker registration failed: ', err));
35
- // }
Original file line number Diff line number Diff line change @@ -498,6 +498,8 @@ export class SeedConfig {
498
498
'@angular/router' : 'node_modules/@angular/router/bundles/router.umd.js' ,
499
499
'@angular/animations/browser' :
500
500
'node_modules/@angular/animations/bundles/animations-browser.umd.js' ,
501
+ '@angular/service-worker' :
502
+ 'node_modules/@angular/service-worker/bundles/service-worker.umd.js' ,
501
503
'tslib' : 'node_modules/tslib/tslib.js' ,
502
504
503
505
'@angular/common/testing' :
You can’t perform that action at this time.
0 commit comments