Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _.each(data.recipe, function(recipeItem) {
- var recipeMap = that.get('recipeMap');
- recipeMap[recipeItem.id] = { id: recipeItem.id, quantity: recipeItem.quantity };
- });
- console.log(that.get('recipeMap')); //not ready yet.
- async.each(data.recipe, function(recipeItem, callback) {
- var recipeMap = that.get('recipeMap');
- recipeMap[recipeItem.id] = { id: recipeItem.id, quantity: recipeItem.quantity };
- callback(); // show that no errors happened
- }, function(err) {
- if(err) {
- console.log("There was an error" + err);
- } else {
- console.log("Loop is done");
- }
- });
- _.each(collection, function(model) {
- if(model.collection.indexOf(model) + 1 == collection.length) {
- // Callback goes here
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement