Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IQService

$q - service in module ng A promise/deferred implementation inspired by Kris Kowal's Q. See http://docs.angularjs.org/api/ng/service/$q

Hierarchy

  • IQService

Callable

  • __call<T>(resolver: function): IPromise<T>
  • __call<T>(resolver: function): IPromise<T>

Index

Constructors

Methods

Constructors

constructor

  • new IQService<T>(resolver: function): IQService
  • new IQService<T>(resolver: function): IQService

Methods

all

  • Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.

    Returns a single promise that will be resolved with an array of values, each value corresponding to the promise at the same index in the promises array. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.

    Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    Parameters

    Returns IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>

  • Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    Parameters

    Returns IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>

  • Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    Parameters

    Returns IPromise<[T1, T2, T3, T4, T5, T6, T7, T8]>

  • Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    Parameters

    Returns IPromise<[T1, T2, T3, T4, T5, T6, T7]>

  • Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    Parameters

    Returns IPromise<[T1, T2, T3, T4, T5, T6]>

  • Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    Parameters

    Returns IPromise<[T1, T2, T3, T4, T5]>

  • Type parameters

    • T1

    • T2

    • T3

    • T4

    Parameters

    Returns IPromise<[T1, T2, T3, T4]>

  • Type parameters

    • T1

    • T2

    • T3

    Parameters

    Returns IPromise<[T1, T2, T3]>

  • Type parameters

    • T1

    • T2

    Parameters

    Returns IPromise<[T1, T2]>

  • Type parameters

    • TAll

    Parameters

    Returns IPromise<TAll[]>

  • Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.

    Returns a single promise that will be resolved with a hash of values, each value corresponding to the promise at the same key in the promises hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.

    Parameters

    • promises: object

      A hash of promises.

    Returns IPromise<object>

  • Type parameters

    • T: object

    Parameters

    • promises: object

    Returns IPromise<T>

defer

  • Creates a Deferred object which represents a task which will finish in the future.

    Type parameters

    • T

    Returns IDeferred<T>

reject

  • Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it.

    When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of reject as the throw keyword in JavaScript. This also means that if you "catch" an error via a promise error callback and you want to forward the error to the promise derived from the current promise, you have to "rethrow" the error by returning a rejection constructed via reject.

    Parameters

    • Optional reason: any

      Constant, message, exception or an object representing the rejection reason.

    Returns IPromise<any>

resolve

  • 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.

    Type parameters

    • T

    Parameters

    • value: IPromise<T> | T

      Value or a promise

    Returns IPromise<T>

  • 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.

    Returns IPromise<void>

when

  • 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.

    Type parameters

    • T

    Parameters

    • value: IPromise<T> | T

      Value or a promise

    Returns IPromise<T>

  • 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.

    Returns IPromise<void>

Generated using TypeDoc