0
值后,我有一些代码,如下图所示:无法读取角度推
$scope.offer = [];
angular.forEach($scope.details, function (product) {
SomeAPI.ById.query({ product: product.id }, function (response) {
$scope.offer.push(response);
});
return $scope.offer;
});
console.log($scope.offer);
为什么控制台日志仍然没有把“[]
”? 在页面上,{{ offer }}
正确显示值。
可能重复[如何返回来自异步调用的响应?](http://stackoverflow.com/questions/14220321/how-do-i-return-the-response -from-一个异步呼叫) – Tushar