How to cancel an $http request in AngularJS?

前端 未结 8 956
面向向阳花
面向向阳花 2020-11-22 09:49

Given a Ajax request in AngularJS

$http.get(\"/backend/\").success(callback);

what is the most effective way to cancel that request if anot

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 10:32

    Cancelation of requests issued with $http is not supported with the current version of AngularJS. There is a pull request opened to add this capability but this PR wasn't reviewed yet so it is not clear if its going to make it into AngularJS core.

提交回复
热议问题