添加Service Worker 缓存网站

This commit is contained in:
小海
2020-05-17 00:07:20 +08:00
parent 565fc9f673
commit 955f537d59
7 changed files with 108 additions and 4 deletions

View File

@@ -12,6 +12,8 @@ import {FooterComponent} from './components/footer/footer.component';
import {AppRoutingModule} from './app-routing.module';
import {LoginRegistrationModule} from './view/login-registration/login-registration.module';
import {AdminModule} from './view/admin/admin.module';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';
registerLocaleData(zh);
@@ -30,7 +32,8 @@ registerLocaleData(zh);
HttpClientModule,
BrowserAnimationsModule,
LoginRegistrationModule,
AdminModule
AdminModule,
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })
],
providers: [{provide: NZ_I18N, useValue: zh_CN}],
exports: [],