鉴于截至今天(2016 年 12 月)--mobile
标志已从 Angular-cli ( Github statement ) 中暂时删除,您将如何在 Angular 应用中实现 service-workers ?预先感谢您
编辑:这是来自 #IO17 的关于 PWA 和 Angular 的新演讲:Stephen fluid's talk on PWAs and Angular, Google IO 17
最佳答案
您可以使用诸如 serviceworker-webpack-plugin
之类的插件:https://github.com/oliviertassinari/serviceworker-webpack-plugin
您还可以在这里找到很棒的教程:https://coryrylan.com/blog/fast-offline-angular-apps-with-service-workers
我建议您首先阅读本教程,因为它向您展示了您不一定需要额外的插件才能在应用中使用服务工作人员。
关于javascript - Angular 2 应用程序中的 Service Worker 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41046623/