Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Add promise support to respond method of $httpBackend.when(...) calls #11245

@ChrisPearce

Description

@ChrisPearce

It would be useful for the "respond" method of the httpBackend.when(...) calls to support promises.

Currently the respond method accepts either:

  • a set of static data to be returned; or
  • a function that can return an array containing response status (number), response data (string), response headers (Object), and the text for the status (string).

The limitation occurs when wanting to use $httpBackend for backend-less development of applications that use the $http service, with scenarios where the "fake" data can only be returned by asynchronous operations (e.g. calls to indexeddb).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions