0
我有以下的HTTP GET請求: -如何實現http獲取請求的承諾?
$http({
method: 'GET',
url: 'getData.php',
params: {bill: 'Active'}
})
.then(function (response) {
bill=response.data.results;
});
的請求進行多次,我想對於處理要等到所有的http請求完成。爲此,我想實現承諾,然後在函數結束時返回承諾。我怎樣才能實現這個HTTP獲取請求的承諾?
請參閱[AngularJS $ q服務API參考 - $ q.all](https://docs.angularjs.org/api/ng/service/$q#all)。 – georgeawg