angularjs服务和响应

时间:2016-08-16 10:06:27

标签: javascript angularjs

为什么我的$scope.aux为空,而响应是否真的存在?

响应:

enter image description here

我在工厂有以下内容:

    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);

0 个答案:

没有答案