2
我想單獨更新一個帖子的集合,並且在每個請求完成後再重新呈現我的集合。主幹集合:_.after在異步請求之後不會調用
目前低於從不代碼觸發renderPosts,我不知道爲什麼
onClickCopyPosts: function(posts, publish_target) {
var self = this;
var renderPosts = _.after(posts.length, function() {
console.log('got here');
self.collection.fetch({reset: true});
});
_.each(posts, function(post) {
post = new PostModel(post);
post.set('id', null);
post.set('publish_target', publish_target);
post.save({success: renderPosts});
});
},