如何离线运行角度js应用程序 [英] How to run angular js application offline

查看:80
本文介绍了如何离线运行角度js应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

我们已经在角度js上开发了一个应用程序,当它连接到互联网时工作正常但是当互联网断开连接时应用程序没有运行,我的应用程序将被运行在局域网上,即使互联网断开连接,我的应用程序也被ipaddress访问,任何人都可以告诉我如何运行离线运行我们的角度js应用程序。



谢谢


We have developed an application on angular js, it works fine when the pc is connected to internet but application doesn't run when the internet is disconnected,my application is to be run on LAN so that my application is accessed by ipaddress even if the internet is disconnected, can any one tell me how to run our angular js application run offline.

Thank you

推荐答案

为此,W3.Org向您介绍了离线应用程序,这些应用程序并非所有应用程序(IMO),而只是允许您保持活动并保持不变的页面盯着没有互联网连接,连接后再试一次。在旧应用程序中,一旦您加载资源,浏览器将在一天内查看未连接(或相同)页面,网页将被维护,但消息是相同的。



以下是您在离线世界潜水前需要查看的一些链接。



https://developer.mozilla。 org / en-US / Apps / Build / Offline [ ^ ]

http://www.w3.org/ TR / offline-webapps / [ ^ ]

http://diveintohtml5.info/offline.html [ ^ ]

http://www.html5rocks.com/en/features/offline [ ^ ]



这些离线应用程序背后的主要逻辑是他们尝试连接到互联网,异步,抱着tly到浏览器。如果找到资源,那么您已连接到互联网,如果有超时错误,则找不到资源且您已离线。这就是这些离线应用程序背后的逻辑。



记住,浏览器不允许网站与机器通信,因为它可能会将机器暴露给恶意网站。此外,在这种情况下,您应该考虑使用localStorage存储用户在脱机时所需的数据。您可以在线时存储所需的二进制文件和程序集,以便在脱机时可以使用它们。 如果这可以帮助您确保应用程序在离线时运行
For this sake, W3.Org introduced you with offline applications, which are not all applications (IMO) but are just pages that allow you to stay active and keep staring at the "No internet connection, try again once connected". In old applications, once you would load the resource the browser would view a page "Not connected" (or same) in now a days, the web page is maintained, but the message is same.

Here are a few links that you need to see before diving in the offline world.

https://developer.mozilla.org/en-US/Apps/Build/Offline[^]
http://www.w3.org/TR/offline-webapps/[^]
http://diveintohtml5.info/offline.html[^]
http://www.html5rocks.com/en/features/offline[^]

The main logic behind these offline applications is that they try to connect to the internet, asynchronously, holding tightly to the browser. If resource is found, then you are connected to the internet, if there was a timeout or error then the resource was not found and you are offline. That is the logic behind these offline applications.

Remember, browser doesn't allow websites to communicate with the machine because it might expose the machine to a malicious website. Also, in such cases you should consider using localStorage to store the data that your user would want in case he is offline. You can store the required binaries and assemblies when he is online, so that he can use them when he is offline. If that helps you to make sure that application runs while offline.


Hello santoshkumar,

根据您的问题我认为您给出任何javascript的直接dll引用

所以这意味着当互联网与PC连接时运行顺畅但当时互联网不存在时它不起作用..





所以为了解决这种类型的解决方案,请下载您的参考java脚本文件并存储在您的项目文件位置,并更改此java脚本的引用



就像你可以在bundle.config文件中提供引用一样



Hello santoshkumar,
as per your problem i think you give a directly dll reference of any javascript
so it means when internet is connected with pc at that time is run smoothly but when internet is not existing at that time its not work..


so for solve this type of solution download your references java script file and store in your project file location and also change references of this java script

like you can give references in bundle.config file like

bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));









i希望这会对你有所帮助

谢谢

Uttam Katariya





i hope this helps to you
Thanks
Uttam Katariya


这篇关于如何离线运行角度js应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆