API Docs for: 0.1.4
Show:

Promise Class

Module: Builtins

An instance of a promise. Created and accessed through $q.

Constructor

Promise

() private

Item Index

Methods

catch

(
  • onReject
)
Promise chainable

Registers a rejection handler. Shorthand for .then(_, onReject).

Parameters:

  • onReject Object

    Executed 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
)
Promise chainable

Attach resolution, rejection and notification handlers to the promise.

Parameters:

  • onResolve Function

    Executed 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 Function

    Executed when the promise is rejected

  • onNotify Function

    Executed when the promise notified

Returns: