0
我想在每個請求發送到API之前清除我的http響應。如何使用angular js在每個http請求之前銷燬響應?
My Http request:
$http(
{
method: 'GET',
url: URI,
headers: { 'Content-Type': 'application/json' },
async: false
}).success(function (data) {
$('#processing').hide();
$scope.items = JSON.parse(angular.toJson(data));
$scope.header = $scope.items[0];
你能幫我嗎,這樣每次我都會得到新的迴應嗎?
感謝
每個請求都是異步請求。在調用之前,U無法清除響應。將下一個請求放入完整的函數中 – Vicky 2015-02-23 10:25:11