{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/11245","labels_url":"https://api.github.com/repos/angular/angular.js/issues/11245/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/11245/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/11245/events","html_url":"https://github.com/angular/angular.js/issues/11245","id":59882102,"number":11245,"title":"Add promise support to respond method of $httpBackend.when(...) calls","user":{"login":"ChrisPearce","id":402894,"avatar_url":"https://avatars.githubusercontent.com/u/402894?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisPearce","html_url":"https://github.com/ChrisPearce","followers_url":"https://api.github.com/users/ChrisPearce/followers","following_url":"https://api.github.com/users/ChrisPearce/following{/other_user}","gists_url":"https://api.github.com/users/ChrisPearce/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisPearce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisPearce/subscriptions","organizations_url":"https://api.github.com/users/ChrisPearce/orgs","repos_url":"https://api.github.com/users/ChrisPearce/repos","events_url":"https://api.github.com/users/ChrisPearce/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisPearce/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-04T23:47:44Z","updated_at":"2015-03-04T23:47:44Z","closed_at":null,"body":"It would be useful for the \"respond\" method of the httpBackend.when(...) calls to support promises.\r\n\r\nCurrently the respond method accepts either:\r\n* a set of static data to be returned; or\r\n* a function that can return an array containing response status (number), response data (string), response headers (Object), and the text for the status (string).\r\n\r\nThe 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).\r\n\r\n"}}