Angular HttpPromise: difference between `success`/`error` methods and `then`'s arguments

后端 未结 6 1000
别那么骄傲
别那么骄傲 2020-11-22 16:59

According to AngularJS doc, calls to $http return the following:

Returns a promise object with the standard then

6条回答
  •  长发绾君心
    2020-11-22 17:23

    Official Notice: success and error have been deprecated, please use the standard then method instead.

    Deprecation Notice: The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error.

    link: https://code.angularjs.org/1.5.7/docs/api/ng/service/$http

    screenshot: view the screenshot

提交回复
热议问题