且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何根据ID之外的某些属性从集合中查找模型?

更新时间:2023-12-02 20:59:58

Backbone集合支持underscorejs 找到方法,所以使用它应该有效。

Backbone collections support the underscorejs find method, so using that should work.

things.find(function(model) { return model.get('name') === 'Lee'; });