Skip to content

Instantly share code, notes, and snippets.

@matthewhudson
Created August 23, 2013 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewhudson/6320803 to your computer and use it in GitHub Desktop.
Save matthewhudson/6320803 to your computer and use it in GitHub Desktop.
BackboneJS: Automatically extend event from a base view
var ParentView = Backbone.View.extend({
'events': {
'click .parent-something': "onParentSomethingClick"
}
});
var ChildView = ParentView.extend({
'events': _.extend({
'click .something': 'onSomethingClick',
}, ParentView.prototype.events)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment