After successfully transitioning my functional angularjs web app to Cordova and compiling it for iOS, I encountered an issue while testing the app on iOS. When trying to access a local file from inside a callback response (after successfully accessing another local file with a 200 status), I kept receiving a 404 error. I even tried making both the initial request and the request from the callback to the same file, but the error persisted. Interestingly, when I changed the file to a remote URL, everything worked fine. Below is the relevant code snippet:
function promiseFunc1() {
var wait = $q.defer();
$http.get('config/resources.json').success(function (data, status, headers, config) {
wait.resolve(data);
});
return wait.promise;
}
function promiseFunc2() {
var wait = $q.defer();
$http.get('config/resources.json').success(function (data, status, headers, config) {
wait.resolve(data);
});
return wait.promise;
}
promiseFunc1()
.then(function (result) {
return promiseFunc2()
})
.done()
Any guidance on where I might be going wrong would be greatly appreciated!