I am trying to fire abort request however, I am not getting $cancelRequest
object in result of $resource
. But, I am able to get $promise
and $resolved
objects.
Why is this happening? How can I get this $cancelRequest
?
PS: I'm using AngularJS 1.5
UPDATE: After some trial and errors I found that it was not working just because I was using AngularJS 1.5 rc 0. Now when I used AngularJS 1.5 rc 2. which is the current latest, it just worked.
According to documentation, it is only available for Angular 1.5 :
I cannot see any mention of it on Angular 1.4...
I can only suggest you to update to 1.5 version but it is still an rc-1 version...
To enable it, you have to configure $resource, by default, it is disable :
Working with this code