I have an Angular Service I'm trying to set up to retrieve data from a node server that serving JSON files to the application. I've checked the node server URL's and they're all outputting JSON like they should be, but Angular appears to be unable to get them due to the HTTP headers. From some googling this looks like a common problem, I'm just not sure how or even if there's a work around?
eventsApp.factory('eventData', function($http, $log) {
return {
getEvent: function(successcb) {
$http({method: 'GET', url: 'http://localhost:8000/data/event/1'}).
success(function(data, status, headers, config){
successcb(data);
}).
catch(function(data, status, headers, config){
$log.warn(data, status, headers, config);
})
}
}
});
In the console I'm getting the following warning from the catch:
Object { data: null, status: 0, headers: headersGetter/<(), config: Object, statusText: "" } undefined undefined undefined