add this to main.ts
:
platformBrowserDynamic().bootstrapModule(AppModule).then(() => { if ('serviceWorker' in navigator && environment.production) { navigator.serviceWorker.register('ngsw-worker.js'); } }).catch(err => console.log(err));
References
https://stackoverflow.com/questions/48723206/angular-5-service-worker-not-working