You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
I'm building a mobile web application using AngularJS, and I'm encountering the following issue. My application is cached using an HTML5 Application cache. It loads fine, but if I manually kill the browser (or cause Android WebKit to unload the document), I encounter a problem in $httpBackend:
function completeRequest(callback, status, response, headersString) {
// URL_MATCH is defined in src/service/location.js
var protocol = (url.match(URL_MATCH) || ['', locationProtocol])[1];
// fix status code for file protocol (it's always 0)
status = (protocol == 'file') ? (response ? 200 : 404) : status;
// normalize IE bug (http://bugs.jquery.com/ticket/1450)
status = status == 1223 ? 204 : status;
console.log(callback);
callback(status, response, headersString);
$browser.$$completeOutstandingRequest(noop);
}
In the case of loading a file from the appcache (in this case, the template to a particular route for ng-view), status == 0. Because of this, $http rejects the promise instead of resolving it, and the view is never loaded.
I'm wondering if this line could be added after the file protocol check:
I'm building a mobile web application using AngularJS, and I'm encountering the following issue. My application is cached using an HTML5 Application cache. It loads fine, but if I manually kill the browser (or cause Android WebKit to unload the document), I encounter a problem in $httpBackend:
In the case of loading a file from the appcache (in this case, the template to a particular route for ng-view), status == 0. Because of this, $http rejects the promise instead of resolving it, and the view is never loaded.
I'm wondering if this line could be added after the file protocol check:
This solves the appcache problem correctly, but I'm not sure if that solution exposes another problem.
Thanks!
The text was updated successfully, but these errors were encountered: