You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
When trying to access Navigator.serviceWorker() from inside the app (any .ts file such as app.component.ts), I get the following error:
Property 'serviceWorker' does not exist on type 'Navigator'.
Expected behavior:
property serviceWorker exists and also imported by ionic 2 using sw-toolbox, why I can access it only from the index.html as mentioned in the documentation. Why I can't access the service worker from inside my app?
Related code:
if ('serviceWorker' in navigator && 'PushManager' in window) {
console.log(navigator.serviceWorker);
Hello! Thanks for opening an issue with us! As this seems like more of a support question i will urge that you ask this question on our forum or on our slack channel. Thanks for using Ionic!
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Ionic version: (check one with "x")
[ ] 1.x
[ x] 2.x
I'm submitting a ... (check one with "x")
[ ] bug report
[x ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
When trying to access Navigator.serviceWorker() from inside the app (any .ts file such as app.component.ts), I get the following error:
Property 'serviceWorker' does not exist on type 'Navigator'.
Expected behavior:
property serviceWorker exists and also imported by ionic 2 using sw-toolbox, why I can access it only from the
index.html
as mentioned in the documentation. Why I can't access the service worker from inside my app?Related code:
Other information:
May be releated: microsoft/TypeScript#11781
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):The text was updated successfully, but these errors were encountered: