How to call/import/use Angular Service(Typescript - myService.service.ts) in Service worker(sw.js) file?

Viewed 162

I am writing service(health.service.ts) in angular to check health API of back-end server( which return flag based on back-end server down or up), I want to use this flag in service worker.js file for designing service worker functionality. How can i import and use the service(health.service.ts) in sw.js

Note: I'm writing custom service worker code(sw.js) and not using default service worker provide by angular 10 PWA(@angular/pwa).

0 Answers
Related