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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -