angularjs-http

Why are AngularJS $http success/error methods deprecated? Removed from v1.6?

守給你的承諾、 提交于 2019-11-25 21:37:30
问题 The AngularJS documentation has a Deprecation Notice for the $http success and error methods. Is there a specific reason this abstraction was removed from the library? 回答1: The problem was that .success and .error methods are not chainable because they ignore return values . This caused problems for people familiar with chaining and encouraged poor code from people unfamiliar with chaining . Witness all the examples on StackOverflow that use the deferred anti-pattern. To quote one of the