if (xhr != null) { // xhr is AJAX call request object.
console.log("abort");
canceler.resolve();
}
xhr = $http({ method: 'POST', url:("/Home/GetLibrary"), timeout: canceler.promise })
.success(){
alert("success");
})
.error() {
alert("error");
});
Here I check the xhr object. If xhr object is not null then I abort the call. But it aborts the current call, not the previous Ajax call.
I try to call the same function again, then all subsequent AJAX call are aborted.