填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

ServiceWorkerModule

      
      class ServiceWorkerModule {
  static register(script: string, opts: SwRegistrationOptions = {}): ModuleWithProviders<ServiceWorkerModule>
}
    

静态方法

Register the given Angular Service Worker script.

static register(script: string, opts: SwRegistrationOptions = {}): ModuleWithProviders<ServiceWorkerModule>
      
      static register(script: string, opts: SwRegistrationOptions = {}): ModuleWithProviders<ServiceWorkerModule>
    
参数
script string
opts SwRegistrationOptions

可选. 默认值是 {}.

返回值

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