mode_edit codeAPI / @angular/service-workerServiceWorkerModulelinkclass 试验性的class ServiceWorkerModule { static register(script: string, opts: {...}): ModuleWithProviders }静态方法linkregister() linkmode_edit codeRegister the given Angular Service Worker script.static register(script: string, opts: { scope?: string; enabled?: boolean; } = {}): ModuleWithProviders参数scriptType: string.optsType: { scope?: string; enabled?: boolean; }.可选. 默认值是 {}.返回值ModuleWithProvidersIf enabled is set to false in the given options, the module will behave as if service workers are not supported by the browser, and the service worker will not be registered.注解link@NgModule({ providers: [SwPush, SwUpdate] })