Help Angular by taking a 1 minute survey!Go to surveyHome

SwUpdate

Subscribe to update notifications from the Service Worker, trigger update checks, and forcibly activate updates.

      
      class SwUpdate {
  available: Observable<UpdateAvailableEvent>
  activated: Observable<UpdateActivatedEvent>
  isEnabled: boolean
  checkForUpdate(): Promise<void>
  activateUpdate(): Promise<void>
}
    

Properties

Property Description
available: Observable<UpdateAvailableEvent> Read-only.

Emits an UpdateAvailableEvent event whenever a new app version is available.

activated: Observable<UpdateActivatedEvent> Read-only.

Emits an UpdateActivatedEvent event whenever the app has been updated to a new version.

isEnabled: boolean Read-only.

True if the Service Worker is enabled (supported by the browser and enabled via ServiceWorkerModule).

Methods

checkForUpdate(): Promise<void>
      
      checkForUpdate(): Promise<void>
    
Parameters

There are no parameters.

Returns

Promise<void>

activateUpdate(): Promise<void>
      
      activateUpdate(): Promise<void>
    
Parameters

There are no parameters.

Returns

Promise<void>