Created
August 7, 2015 19:55
-
-
Save stevehanson/eb9d6b11e6135d656f24 to your computer and use it in GitHub Desktop.
RSVP.all Promises Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let promises = []; | |
comments.forEach((comment) => { | |
promises.push(comment.save()); | |
}); | |
Ember.RSVP.all(promises).then((comments) => { | |
post.get('comments').addObjects(comments); | |
post.save(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment