简体   繁体   English

在离线模式下运行Angular6应用程序

[英]Run Angular6 Application in offline mode

I am working on Angular 6 application. 我正在开发Angular 6应用程序。 One of the feature expected is that even if the web server network is not available i should be able to run my Angular application in browser in offline mode. 预期的功能之一是,即使Web服务器网络不可用,我也应该能够以脱机模式在浏览器中运行Angular应用程序。 I should be able to close the browser and open again when required. 我应该能够关闭浏览器并在需要时再次打开。 Next time if network is available application can start in online mode. 下次如果网络可用,应用程序可以在线模式启动。 Is this possible? 这可能吗?

Yes that's possible, that is one of the great features of a service-worker. 是的,这是可能的,这是服务人员的一大特色。 Just remember that it would be possible because it saves the last state available of the page in cookies, so it is possible if the cookies are not deleted in the browser and it would depend of the browser the user has too. 请记住,这是有可能的,因为它会将页面的最后可用状态保存在cookie中,因此,如果没有在浏览器中删除cookie,这也有可能取决于用户使用的浏览器。

I recommend you to read the angular's documentation about it: 我建议您阅读有关角度的文档:

https://angular.io/guide/service-worker-intro https://angular.io/guide/service-worker-intro

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM