Promise Class
An instance of a promise. Created and accessed through $q.
Constructor
Promise
()
private
Methods
catch
-
onReject
Registers a rejection handler. Shorthand for .then(_, onReject).
Parameters:
-
onRejectObjectExecuted when the promise is rejected. Receives the rejection reason as argument.
Returns:
notify
-
notifyWith
Send a notification to the promise.
Parameters:
-
notifyWithNotification value
reject
-
rejectWith
Rejects the promise.
Parameters:
-
rejectWithRejection reason. Will be passed on to the rejection handlers
resolve
-
resolveWith
Resolves the promise.
Parameters:
-
resolveWithThis value is passed on to the resolution handlers attached to the promise.
then
-
onResolve -
onReject -
onNotify
Attach resolution, rejection and notification handlers to the promise.
Parameters:
-
onResolveFunctionExecuted when the promise is resolved. If another promise is returned, the next promise in the chain is attached to the returned promise. If a value is returned, the next promise in the chain is resolved with the returned value immediately.
-
onRejectFunctionExecuted when the promise is rejected
-
onNotifyFunctionExecuted when the promise notified
