Click here to Skip to main content
15,868,292 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI,
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
Posted
Updated 10-Sep-15 3:00am
v2

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.
 
Share this answer
 
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

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




i hope this helps to you
Thanks
Uttam Katariya
 
Share this answer
 
v2
Comments
Uttam katariya 10-Sep-15 8:30am    
why this answer is devoted?
F-ES Sitecore 10-Sep-15 9:32am    
I didn't downvote, but it doesn't have any relation to the problem asked, and the solution also makes no sense as bundling doesn't mean your files are available off-line.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900