I've a little problem with my request to an external API which use X-Auth-Token :
'user strict';
app.controller("controller" ,function($scope,$http) {
$scope.result = $.ajax({
headers: { 'X-Auth-Token': '*****' },
url: 'http://api.************',
dataType: 'json',
type: 'GET',
success: function(data){
return data;
}
});
console.log($scope.result);
});
When i try to do this :
console.log($scope.result.responseJSON);
The result is this one an undefined object. Any ideas about this problem ?