How are 'change' events handled in backbone models?
问题 I'm trying to build a model that dynamically updates Session variables in a Meteor project. I know that plain JSON should not be stored within backbone models, so I have a Special model set up like so: initialize : function () { // Log the changed properties this.on('change', function (model, options) { for ( var i in options.changes) this.display(i); Session.set('NewSpecial', model); }); }, //Attributes defaults: { "Product" : null, "ShortDescription" : null, "Category" : "food", "Price" :