ServiceWorkerModule

      
      class ServiceWorkerModule {
  static register(script: string, opts: { scope?: string; enabled?: boolean; } = {}): ModuleWithProviders<ServiceWorkerModule>
}
    

静态方法

Register the given Angular Service Worker script.

static register(script: string, opts: { scope?: string; enabled?: boolean; } = {}): ModuleWithProviders<ServiceWorkerModule>
      
      static register(script: string, opts: { scope?: string; enabled?: boolean; } = {}): ModuleWithProviders<ServiceWorkerModule>
    
参数
script string
opts object

可选. 默认值是 {}.

返回值

ModuleWithProviders<ServiceWorkerModule>

If 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.

提供商

提供商
      
      SwPush
    
      
      SwUpdate