I'm trying to fire a callback when multiple ember models have finished their save methods.
var promises = [];
modellist.forEach(function(mymodel){
promises.push(mymodel.save())
}
$.when.apply(null, promises).done(function () {
console.log('finished promises');
}
console.log('finished method');
The apply function is executed immediately.
Question: Which of the following is true?
- promise != ember-promise
- promise != deferred
- ember-promise != deferred
Aucun commentaire:
Enregistrer un commentaire