要在 Backbone 集合中设置数据:
var someList = ['a', 'b', 'c'];
collection.reset({models:someList});
有没有办法用 a 来做到这一点model
而不必调用set()
每一个属性?
例子
var pop_star = {
first_name: "Stacey",
last_name: "Ferguson"
}
// There is no "reset()" function on a model, but is there something like it?
model.reset(pop_star);
谢谢!