Skip to content

Instantly share code, notes, and snippets.

@kristiyandobrev
Created June 9, 2016 09:05
Show Gist options
  • Save kristiyandobrev/63fa907ef8a57d841f6016df54019139 to your computer and use it in GitHub Desktop.
Save kristiyandobrev/63fa907ef8a57d841f6016df54019139 to your computer and use it in GitHub Desktop.
$scope.products = function () {
var promises = {
a: ProductsService.getProducts().promise,
b: PricefixerService.getProducts().promise
};
return $q.all(promises).then(function (values) {
return values.a.concat(values.b);
});
};
//returns an array with objects
// [{
// 'name':'name1',
// 'color':'red'
// },
// {
// 'name':'name2',
// 'color':'white'
// }];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment