javascript - Changing Backbone Model defaults attribute -


i have backbone view. want on click event, able change defaults attribute of model.

inside view initialize use .on function (here doc). example:

  initialize: function(options) {     model.off();  // if forget write line, works  how many time rendered view     model.on( 'all', this._handlechanges, this); // or event  name   } 

edit

i used .off() beacuse here wrote inside on. off event whitch 1 bind on. for more inf


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -