Skip to content

Instantly share code, notes, and snippets.

@shaohua
Created November 4, 2013 00:17
Show Gist options
  • Select an option

  • Save shaohua/7296333 to your computer and use it in GitHub Desktop.

Select an option

Save shaohua/7296333 to your computer and use it in GitHub Desktop.
backbone delegateevents
events: {
'click body': 'onClickBody'
},
onClickBody: function(){
console.log('click');
},
render: function(){
this.template();
return this;
},
renderAgain: function(){
this.$el.html('this will lose event binding')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment