Created
February 22, 2016 14:39
-
-
Save 4nduril/dab571e876b215e3786f to your computer and use it in GitHub Desktop.
Backbone View not redelegating events
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 sampleView = Backbone.View.extend({ | |
events: { | |
"click": "myClickHandler" | |
}, | |
render: { | |
// the following constructor creates an element with the class ".test" and adds it to the DOM | |
var newElemInstance = new externalModuleConstructor(); | |
this.setElement(document.querySelector(".test")); | |
} | |
}); | |
var view = new SampleView(); | |
// view.$el --> <div class="test"> | |
// click on <div class="test"> doesn't call myClickHandler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment