ServiceWorkerModule

From Get docs
< @angular/service-workerAngular/docs/8/api/service-worker/serviceworkermodule /
Revision as of 02:28, 6 December 2021 by Notes (talk | contribs) (Page commit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


ServiceWorkerModule

ngmodule

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

Static methods

Register the given Angular Service Worker script.

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

Parameters
script string
opts SwRegistrationOptions Optional. Default is {}.
Returns

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.

Providers

Provider
SwPush
SwUpdate


© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v8.angular.io/api/service-worker/ServiceWorkerModule