I have created two collections in backbone and I want to bind the first collection to a model change event from the second collection.
var ProjectUserList = Backbone.Collection.extend({
model: app.projectUser,
url: config.base + 'api/project/project_users'
});
//instantiate
app.projectUserList = new ProjectUserList();
Second collection with bound change event from first:
var FileList = Backbone.Collection.extend({
initialize: function () {
app.projectUserList.on('change', this.updateShare);
},
updateShare: function () {
console.log(this);
}
});
How do I know which model has changed in the collection?