diff --git a/src/app/app.component.ts b/src/app/app.component.ts index d0198ee..63409a2 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,7 +1,13 @@ import { Component } from '@angular/core'; +import {MatSnackBar} from "@angular/material/snack-bar"; +import {SwUpdate} from "@angular/service-worker"; @Component({ selector: 'app-root', templateUrl: 'app.component.html' }) -export class AppComponent { } +export class AppComponent { + constructor(private snackbar: MatSnackBar, private update: SwUpdate) { + update.available.subscribe(() => snackbar.open('Update Available!! 🚀', 'Reload').onAction().subscribe(() => update.activateUpdate())) + } +}