Google Progressive App(PWA)我们可以使用IONIC吗?

时间:2017-12-09 05:03:18

标签: angular polymer ionic3 progressive-web-apps

我想构建一个Google Progressive App(PWA)。

任何人都可以建议我可以将IONIC 3 / angular 4用于Google Progressive App吗?

或者我必须使用聚合物? 感谢

2 个答案:

答案 0 :(得分:0)

您可以使用PWA轻松开发Ionic 3 /Angular个应用。离子骨架具有开箱即用的功能。但是,如果您需要开发Google Progressive Web Apps,那么您需要使用vanilla javascript。你不能把这两个人混在一起。

您可以使用以下链接查看如何使用Ionic 3 /Angular开发PWA。

What Progressive Web Apps can do for you

How to make PWAs with Ionic

答案 1 :(得分:0)

Ionic默认支持基本的ServiceWorker和Manifest支持。

取消注释index.html中的以下行:

  <!-- un-comment this code to enable service worker
  <script>
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker.register('service-worker.js')
        .then(() => console.log('service worker installed'))
        .catch(err => console.error('Error', err));
    }
  </script>-->

您随后可以在src/service-worker.js内更改缓存策略和实施。

相关问题