$q.when()

when(value, [successCallback], [errorCallback], [progressCallback]);

Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.

Parameters

Param Type Details
value *

Value or a promise

successCallback
(optional)
Function=
errorCallback
(optional)
Function=
progressCallback
(optional)
Function=

Returns

Promise

Returns a promise of the passed value or promise

doc_AngularJS
2016-03-29 16:10:35
Comments
Leave a Comment

Please login to continue.