kinstephen / angular-azure-blob-upload

AngularJS mobule for uploading to azure blob storage in chunks.
MIT License
32 stars 30 forks source link

Angular 1.6 - Change .success and .error to use .then promise for #14

Closed jaredgermano closed 7 years ago

jaredgermano commented 7 years ago

Per https://github.com/angular/angular.js/commit/b54a39e2029005e0572fbd2ac0e8f6a4e5d69014 and https://toddmotto.com/angular-1-6-is-here#http-success-and-error

.success and .error are removed in v1.6 of Angular

kinstephen commented 7 years ago

Before I pull this change in can you confirm this change will be backwards compatible with older AngularJS versions?

jaredgermano commented 7 years ago

Hi there,

Yes, it is backwards compatible. Using .then calls is part of the standard Promise API in angular. https://docs.angularjs.org/api/ng/service/$q

Just to be sure I tested it back to v1.0.1 and .then is defined and behaves as I’d expect.

https://codepen.io/anon/pen/NdqdGw Most of the code was taken from this example $q example in the link above.

Let me know if you have any other questions.

Best Regards, Jared Germano