1
以下是我的$ http呼叫。请问角有像成功一些功能说以前将实际$ HTTP调用之前执行
$http.post(postUrl, $scope.tempData, {
}).success(function(response) {
alert(response);
}).error(function (errorCode) {
alert(errorCode);
}
);
为什么你需要这个功能? –
我想在通话前给页面添加一个加载器,并在调用后成功删除它! –
看看这个小提琴http://fiddle.jshell.net/dBR2r/8/并搜索angularjs ajax微调器。基本思想是在$ htto中的requestInterceptor和responseIntereptor中执行一些操作。另请参阅$ http文档。 – Chandermani