How to use eventHandlers and uploadEvntHandlers with angularjs 1 http requests? How to use eventHandlers and uploadEvntHandlers with angularjs 1 http requests? angularjs angularjs

How to use eventHandlers and uploadEvntHandlers with angularjs 1 http requests?


Don't use onprogress, use just progress, same with other events. I prepare a plunkr to demonstrate:

  $http({      method: "GET",      url: "data.json",      eventHandlers: {        progress: function(event) {          console.log("progress");          console.log(event);        },        readystatechange: function(event) {          console.log("change");          console.log(event);        }      },      uploadEventHandlers: {        progress: function(object) {          console.log(object);        }      }    })    .success(function(json) { // succès      $scope.lemmes = json;      //console.log($http);    }).error(function(error) { // erreur      console.log(error);    });

Also, there was a bug that has been fixed in angular 1.5.5 as it can be seen from the CHANGELOG. Update to the 1.5.5 or higher and it will work.