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