我正在使用该where
方法从集合中获取一些特定模型。类似于骨干站点的示例:
var friends = new Backbone.Collection([
{name: "Athos", job: "Musketeer"},
{name: "Porthos", job: "Musketeer"},
{name: "Aramis", job: "Guard"},
{name: "d'Artagnan", job: "Guard"},
]);
var musketeers = friends.where({job: "Musketeer"});
这将返回具有火枪手工作的 2 个模型。
如何将这 2 个 Musketeer 模型放入一个新集合并为其渲染一个 collectionView?