Backbone.js 当集合项发生更改时
当集合项发生更改时,是否触发集合“更改”触发器?如果不是,我应该自己绑起来吗?有人给我举个例子吗?每次更改模型属性时都会触发Backbone.js 当集合项发生更改时,backbone.js,Backbone.js,当集合项发生更改时,是否触发集合“更改”触发器?如果不是,我应该自己绑起来吗?有人给我举个例子吗?每次更改模型属性时都会触发change事件。此事件为模型本身和模型所属的任何集合激发 someCollection.bind("change", function(model, attributes){ // do something with the model, here }); 每次更改模型属性时都会触发change事件。此事件为模型本身和模型所属的任何集合激发 someCollecti
change
事件。此事件为模型本身和模型所属的任何集合激发
someCollection.bind("change", function(model, attributes){
// do something with the model, here
});
每次更改模型属性时都会触发
change
事件。此事件为模型本身和模型所属的任何集合激发
someCollection.bind("change", function(model, attributes){
// do something with the model, here
});
当我使用someCollection.fetch()时,您提供的函数将起作用,我是对的?当我使用someCollection.fetch()时,您提供的函数将起作用,我是对的?