aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng
diff options
context:
space:
mode:
authorArtemy Tregubenko2014-01-03 16:22:55 +0100
committerIgor Minar2014-01-08 00:35:19 -0800
commit95e1b2d6121b4e26cf87dcf6746a7b8cb4c25e7f (patch)
tree37d147542d5124561aa175cff9ad1dceab5d3a7b /src/ng
parent75345e3487642fbc608c3673e64cd7c5d65cb386 (diff)
downloadangular.js-95e1b2d6121b4e26cf87dcf6746a7b8cb4c25e7f.tar.bz2
fix($httpBackend): cancelled JSONP requests will not print error in the console
When you cancel a JSONP request, angular deletes the callback for it. However the script still executes, and since the callback is now deleted and undefined, the script throws an exception visible in the console. The quick fix for this is not to delete the callback, but replace it with `angular.noop`. Closes #5615 Closes #5616
Diffstat (limited to 'src/ng')
-rw-r--r--src/ng/httpBackend.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js
index 29f390e0..565e1b12 100644
--- a/src/ng/httpBackend.js
+++ b/src/ng/httpBackend.js
@@ -54,7 +54,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
} else {
completeRequest(callback, status || -2);
}
- delete callbacks[callbackId];
+ callbacks[callbackId] = angular.noop;
});
} else {