angular $http / jquery complete equivalent
Update Aug 2014: .always
has been renamed .finally
in recent versions of Angular. Prefer .finally
to .always
.
Note that in order to support IE8 you have to call it with bracket notation as ["finally"]
.
You can use .always
in AngularJS
This change is rather new (you could do that in jQuery for a while), you can see the commit here. This requires you to have AngularJS 1.1.5 or higher.
always(callback)
– allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.