backbone.js - Listen to attribute changes in a backbone view -
I want to call a method in my view when its Update: I thought I have Although I recommend you to use a model to keep attributes, If you want to be with the current perspective, then you have to manually trigger the event. I have made your updates so that you can get an idea of how it can work. attributes Gives me an error:
There is no undefined function .
SimpleView = Backbone.View.extend ({initialize: function () {this.attributes = _.extend (this.attributes, Backbone.Events); // update this.attributes.on ('change', this.updateAttributes (), this);}});
attributes with
backbone.Events so that I can hear the changes. Yes ... so now I do not get any more errors, but still nothing happens. Any help would be greatly appreciated.
this.attributes.trigger ('change');
Comments
Post a Comment