Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IHttpPromise<T>

Type parameters

  • T

Hierarchy

Index

Methods

catch

  • catch<TResult>(onRejected: function): IPromise<TResult>
  • Shorthand for promise.then(null, errorCallback)

    Type parameters

    • TResult

    Parameters

    • onRejected: function
        • (reason: any): IPromise<TResult> | TResult
        • Parameters

          • reason: any

          Returns IPromise<TResult> | TResult

    Returns IPromise<TResult>

Optional error

  • The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error.

    deprecated

    Parameters

    Returns IHttpPromise<T>

finally

  • Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.

    Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise'finally' to make your code IE8 and Android 2.x compatible.

    Parameters

    • finallyCallback: function
        • (): any
        • Returns any

    Returns IPromise<IHttpPromiseCallbackArg<T>>

Optional success

  • The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error.

    deprecated

    Parameters

    Returns IHttpPromise<T>

then

  • then<TResult>(successCallback: function, errorCallback?: function, notifyCallback?: function): IPromise<TResult>
  • Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. The successCallBack may return IPromise for when a $q.reject() needs to be returned This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.

    Type parameters

    • TResult

    Parameters

    • successCallback: function
    • Optional errorCallback: function
        • (reason: any): any
        • Parameters

          • reason: any

          Returns any

    • Optional notifyCallback: function
        • (state: any): any
        • Parameters

          • state: any

          Returns any

    Returns IPromise<TResult>

Generated using TypeDoc