如何过滤多个 Backbone.js 集合?像这样的事情:
var a = _.filter([b.models, c.models], function(model){
return model.get('d');
});
谢谢!
最佳答案
您可以通过将两个模型与_.union结合起来来完成这项工作。
var combinedCollection = _.union(b.models, c.models);
var a = _.filter(combinedCollection, function(model){
return model.get('d');
});
关于javascript - UnderscoreJS _.filter 通过多个 BackboneJS 集合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23155479/