javascript - backbone.js / access view from model -
how can access view model in backbone.js.
i love re-render view on model.change().
adding views model's attribute no-no.
why need access view model on change?
in view, bind:
this.model.bind('change', this.modelchanged, this) // (event, function, context) and on, when model changes, view's modelchanged method called automatically.
in version >0.9, proper syntax in view.
this.model.on('change', this.modelchanged, this) // (event, function, context)
Comments
Post a Comment