2

I'm working on an older AngularJS project that has a lot of code and instead of then() in code success() and error() is used.

Is there any painless way or recommendation how to turn all success() and error() into then() without having to change everything manually?

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
Matija Sestak
  • 393
  • 1
  • 10
  • The non-standard `.success` and `.error` methods were a bad bit of API design in the first place. It is best to remove them and use the standard `.then` and `.catch` methods. See [Why are AngularJS $http success/error methods deprecated? Removed from v1.6?](https://stackoverflow.com/a/35331339/5535245). – georgeawg Apr 15 '19 at 10:16

0 Answers0