There is a Resource that receives information about the object. There is a lot of information and depending on the selected object, it can be calculated long enough.
$scope.currentInfo = null; Info = $resource('/info'); $scope.getInfo = function(id) { Info.post({id: id}).$promise.then(function(response) { $scope.currentInfo = response.data; }) }
At some point, the user can request information about another object, without waiting for an answer to the first request. How, then, to cancel the first request, so that it does not overwrite $ scope.currentInfo , if the answer comes later than the second request?
$cancelRequest
function. - Stepan Kasyanenko