angular/angular.js — pull request #1855 by kofalt (2013-01-21 23:52:09+00:00)
Title: fix($q): Make $q more compatible with $http

Brings the deferred functionality of $q in sync with $http. Previously, the functions available to each differed between them, making interoperability less straightforward.

A simple example would be if you want to work with an object that may or may not have been created on the server yet. This patch allows you to write code like this:

```javascript
function example(obj) {
var defer = obj ? $q.defer().resolve(obj) : $http.get("/makeObj");

defer.success(function(obj) {
//run various operations on the object
});
}
```
Previously, working with $q and $http was unintuitive since $q lacks the success/error functions. Also added a promise return to resolve().