You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I also can't get the abort funcnality to work, can You help me to get this to work?
code in controller:
var requests = [];
$scope.search= function (search) {
var previousRequest = requests.pop();
if (previousRequest) {
previousRequest.abort();
}
var res = clientResource.search({'search': search});
requests.push(res);
var promise = res.promise;
promise.then(function (response) {
requests.pop();
return response.data;
});
return promise;
};
When the previousRequest.abort(); is called it never actually abort the pending xhr. clientResource is RequestFactory object. I am using angular version 1.5.6. Can You please show me the right direction to solve this. Thank You a lot.
This is my Event service factory
suboutSvcs.factory "Event", ($resource, RequestFactory) ->
Event = RequestFactory.createResource {url: "#{api_path}/events/:eventId"}
Event::isBidableBy = (company) ->
this.eventable.bidable and this.eventable.buyer_id isnt company._id
Event
DashboardCtrl = ($scope, $rootScope, $location, Company, Event, $filter, $q) ->
...
$scope.request = null
$scope.loadMoreEvents = ->
$scope.request.abortAll if $scope.request!=null
$scope.request = Event.query queryOptions
...
but it sends request several times whenever i click a button and I get 200 and 304
The text was updated successfully, but these errors were encountered: