为什么我的$scope.aux
为空,而响应是否真的存在?
响应:
我在工厂有以下内容:
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;
});
};
呼叫者:
$scope.aux = testservice.getfirm();
console.log("checking");
console.log($scope.aux);