why is my $scope.aux empty, while the response is acually there?
response:
I have the following in the factory:
o.getfirm = function() {
return $http.post('/firms', null, {
headers: {Authorization: 'Bearer '+auth.getToken()}
}).then(function(response){
console.log("getting firm");
console.log(response.data);
return response.data;
});
};
caller:
$scope.aux = testservice.getfirm();
console.log("checking");
console.log($scope.aux);
