I have some code like below:
$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);
Why do the console log still out put "[]"?
On the page, {{ offer }} display value correctly.