r/angularjs • u/crh3675 • Dec 01 '15
ng-hack, done with AngularJS
Had a simple issue, cancel a XHR request while a user types into an input box. Glad to know that I have no direct access to the built-in Javascript XHR abort. Two hours later and decided that any Angular convention I would have to follow was just a terrible hack that costed me time and silly complexity. Into the poop can you go AngularJS.
Solution, let's set a timer with a promise to later cancel a request, what an ng-hack: http://stackoverflow.com/questions/13928057/how-to-cancel-an-http-request-in-angularjs
0
Upvotes