I found a solution and I wanted to post it out there for anyone else who is trying to get an offline html app working with Angular. It appears that Angular internally caches the views that are stored in separate html files. So everything works initially when I go offline. At some point Angular decides it needs to get the view again, it seems to bypass the browser and doesn't look in the application cache for the file. This in turn causes the application to fail.
I moved my separate views into the main routing config as templates instead of template urls. Now everything works offline without any issues. So I am not 100% sure if there is another way to fix this, but this is what I found and it seems to be the only behavior in Angular that seems to bypass the browsers application cache. On Thursday, July 31, 2014 3:34:07 PM UTC-4, Robert Greenberg wrote: > > I wanted to see if anyone out there has any ideas on the issues I am > running into with making my Ionic/Angular mobile web site application to be > able to run disconnected from the server. > > I am using my galaxy S4 to test this out with google chrome. > > I have my manifest file set correctly and verified that all the files are > being stored in the app cache internal page on the mobile browser. > > I then disconnect from the internet and I am able to use my angular > application numerous times offline without issues. All of the views load > and everything goes along as expected. It continues to work even after I > refresh the main page numerous times > > After awhile it will load and I'll see the main index page but then it > will error out saying it can't find my view html file. If I go back into > the app cache internals, the page is still there and if I click into it all > of the data is there also. > > It's like something changed and it's not looking in the cache for it > anymore. > > If I connect online again it will work and then work offline again for a > little while. > > I am looking for any suggestions or input from people that have had > experience with off line angular applications. It seems very finicky and > will work for awhile and then just stop even though all the files are still > in the application cache of the mobile chrome browser. > > Thanks. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
