Skip to content

Instantly share code, notes, and snippets.

@kovacshuni
Created October 2, 2014 11:37
Show Gist options
  • Save kovacshuni/bdd9702d86d518f9a0c5 to your computer and use it in GitHub Desktop.
Save kovacshuni/bdd9702d86d518f9a0c5 to your computer and use it in GitHub Desktop.
Joining promises
app.controller('SomeController', ['$http', function($http) {
var requestA = function () {
$http.post('http://incoming.example.com:9000/v1.0/oauth1/request-token', {})
.success(function(data) {
...
})
.error(function(data, status) {
...
});
};
var requestB = function() {
$http.get('http://incoming.example.com:9000/v1.0/authentication/access-token')
.success(function(data) {
...
})
.error(function(data, status) {
...
});
};
requestA();
requestB();
} ]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment