KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have the following code, where I bind a change to a single attribute "attribute_1". var Mine = Backbone.Model.extend({ initialize: function() { this.bind("change:attribute_1", function() { console.log('changed!'); }); } }); How do I bind two attributes? This doesn't work: var Mine = Backbone.Model.extend({ initialize: function() { this.bind("change:attribute_1, change:attribute_2", function() { console.log('changed!'); }); } }); Nor does this: var Mine = Backbone.Model.extend({ initialize: function() { this.bind("change:attribute_1 change:attribute_2", function() { console.log('changed!'); }); } });
Tags (comma-separated)
Save Edits
Cancel