angular/angular.js — pull request #1676 by gonzaloruizdevilla (2012-12-08 15:54:20+00:00)
Title: feat($http): allow data promises in $http requests

It's possible to bind directly the promise returned by `$http` to the `$scope` model so I think it would look natural to do contrary, to pass to `$http` a data value that is a promise.

I mean something like this:

```javascript
function MyCtrl($scope,$http){
$scope.something = $http.get("geturl");
$scope.update = function(){
$http.post("posturl", $scope.something)
.success(doSomething)
}
}
```

In this pull request I have created a wrapper around `$http` to handle the situation in which data that is a promise.
I have added two unit tests to check this feature.