Please Mr. Hartington help me! I dont know whats going on.. I am making a simple API request to feedly using the attached code. After installing the plugin to enable CORS in Chrome the api request is successful when i run ionic serve but when i run my app in the emulator it returns data:null and status:0 error message. What's going on? How can I solve this?
$scope.feedlyApi = function() {
var req = {
method: 'GET',
url: "http://sandbox.feedly.com/v3/search/feeds",
params: {
'query': 'nursing'
},
headers: {
'Content-Type': 'application/json' ,
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
'Access-Control-Allow-Headers':'X-Requested-With'
}
}
$http(req).success(function(res) {
console.log(res);
console.log('Success', angular.toJson(res.data));
}).error(function(err){
console.error(angular.toJson(err))
})
}