-
Notifications
You must be signed in to change notification settings - Fork 27.4k
$http eventHandlers return $rootScope rather than actual XHR event 1.5.4 #14436
Comments
What kind of attitude is that? See it like this, you had 2 years to provide a PR. |
True, totally agree I didn't provide a PR that doesn't change the fact the bug exist where it shouldn't as this issue was in development for a long time. |
@ghost, this feture was obviously not in development for two years - being in the backlog and low-priority and being in development are not the same thing. That said, if there is a bug, we should totally fix it. Thx for reporting it 👍 |
I was very excited when I saw the 1.5.4 release, i check the releases almost every day for this feature since my post #11547 (comment) at #11547 (the PR was opened in Apr 11, 2015) It also includes a workaround (it is an hack, but you can't just rewrite token refreshing mechanism, based on custom wrapper around $http, to get around of this hack, can you?). Here is the beauty of the hack: you can't archive something like this via $http without the hack |
Well. there's a PR with a fix in place (#14438), it should be fine by the time |
Hopefully that will fix this wrinkle :-) 21 hours is a bit better than 2 years, eh? |
we'll wait for the 1.5.5 anyway :D |
Thank you for your patience @buraktamturk - it is a virtue I am told :-) |
eventHandlers:{"progress":function (e) { are not fired in 1.5.5 1.5.6 1.5.7 15.8 |
@songbaoqiang Could you provide an example? I am sure that the upload event thing works on my projects. |
html<script src="//cdn.bootcss.com/angular.js/1.5.5/angular.min.js"></script>
×
Please choose your file
jsvar FMApp = angular.module('FMApp', ['ur.file']); FMApp.controller('FileManagerCtr', ['$scope', '$http', '$location','$q', var canceller = $q.defer(); FM.upload = function () {
}; |
@songbaoqiang We can add 1.5.10 to the list. eventHandlers and uploadEventHandlers are never triggered. Thus the need for a PR to fix it is still relevant to this day. |
Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
BUG
What is the current behavior?
eventHandlers:{"progress":function (e) {
console.log(e);
}},
uploadEventHandlers: {"progress": function (e) {
console.log(e);
}}
console.log responds with $rootScope
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
attach event handlers for progress to $http post call that uploads a file to the server
upload the file and try to listen for progress info none of the progress information is being passed.
What is the expected behavior?
console.log would return the actual xhr event not $rootScope
What is the motivation / use case for changing the behavior?
I have been waiting 2 years for Angular to track the "progress" event and it still cant get it right?!?!
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
1.5.4 all major browsers Mac and PC
Other information (e.g. stacktraces, related issues, suggestions how to fix)
The text was updated successfully, but these errors were encountered: