Currently we copy the service worker from src/assets to www/assets. It should be copied to www.
Which Ionic Version? 2.0.0-rc.0
Not solved in RC0
yeah i’d just place it in /src directly, because its more “symmtrical” then. index+service-worker are copied into the root(www) the rest is either built etc. and all other stuffs is in assets. otherwise you’d not have the nice resolution of the file paths that you get now even in index.html
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
}
Most helpful comment
yeah i’d just place it in
/srcdirectly, because its more “symmtrical” then. index+service-worker are copied into the root(www) the rest is either built etc. and all other stuffs is in assets. otherwise you’d not have the nice resolution of the file paths that you get now even in index.html