Created
August 23, 2013 15:44
-
-
Save matthewhudson/6320803 to your computer and use it in GitHub Desktop.
BackboneJS: Automatically extend event from a base view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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