0

I've developed a PWA and I need to add a custom service worker to sync the client database data with server database. I did a search and I found examples in JavaScript.

My first question is: is there a way to write my custom service worker in typescript?

If no, is there a way to use type script class in a JavaScript file? I followed this link:

Calling properly TypeScript code from JavaScript

But I use DI in my TS classes and pass instance to constructor. How can I use these classes in JavaScript?

3
  • are you using any framework? Commented Aug 12, 2019 at 9:31
  • I use angular 6 with .net core Commented Aug 12, 2019 at 9:32
  • Take a look at stackoverflow.com/a/26438163/11912521 Commented Aug 18, 2019 at 22:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.