Created
January 3, 2013 00:38
-
-
Save alexmcpherson/4439772 to your computer and use it in GitHub Desktop.
The fallout of the last Backbone View's render method
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 MyView = Backbone.View.extend({ | |
initialize: function() { | |
//Adding an event here that causes problems: | |
this.model.on('change', this.render, this); | |
}, | |
render: function() { | |
this.$el.append( /* some HTML */ ); | |
$('#content').append(this.el); | |
} | |
}); | |
new MyView().render(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment