My application works just perfectly fine on localhost, but when I output it to my /Build
directory and try and open the index.html
file, I get this error when trying to retrieve some JSON data over $http
:
XMLHttpRequest cannot load file:///Users/realph/Desktop/gulp-test/Build/js/data/results.json
Any idea why this is happening? I've never run into this issue before and can't work out what I'm doing wrong...
My $http
service looks like this:
$http.get('./js/data/results.json')
.success(function(data, status, headers, config) {
$scope.data = data;
}).
error(function(data, status, headers, config) {
console.log("Error loading results.json!");
});
Any help is appreciated. Thanks in advance!