Skip to content

Instantly share code, notes, and snippets.

@nicovalencia
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicovalencia/0213b06e5b953c8cea63 to your computer and use it in GitHub Desktop.
Save nicovalencia/0213b06e5b953c8cea63 to your computer and use it in GitHub Desktop.
var items = [{
content: 'hotdog 1'
}, {
content: 'hotdog 2'
}, {
content: 'hotdog 3'
}, {
content: 'hotdog 4'
}, {
content: 'hotdog 5'
}];
var promises = _.map(items, function(item) {
return itemsService.save(item);
});
$q.all(promises).then(function() {
// all done
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment