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:
-
onReject
ObjectExecuted when the promise is rejected. Receives the rejection reason as argument.
Returns:
notify
-
notifyWith
Send a notification to the promise.
Parameters:
-
notifyWith
Notification value
reject
-
rejectWith
Rejects the promise.
Parameters:
-
rejectWith
Rejection reason. Will be passed on to the rejection handlers
resolve
-
resolveWith
Resolves the promise.
Parameters:
-
resolveWith
This 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:
-
onResolve
FunctionExecuted 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.
-
onReject
FunctionExecuted when the promise is rejected
-
onNotify
FunctionExecuted when the promise notified