Skip to content

Instantly share code, notes, and snippets.

@realyze
Last active December 18, 2015 00:29
Show Gist options
  • Save realyze/5697199 to your computer and use it in GitHub Desktop.
Save realyze/5697199 to your computer and use it in GitHub Desktop.
var qProjects = $http.get('db/view/projects/all')
.then(function(res){
if ( ! res.data) {
$q.reject(new Error('No project data received.'));
}
return data;
});
var qClients = $http.get('db/view/clients/map')
.then(function(res) {
if ( ! res.data) {
$q.reject(new Error('No client map data received.'));
}
});
$q.all([qProjects, qClients]).then(function(results) {
//results == [projects, clients]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment