Skip to content

Instantly share code, notes, and snippets.

@alexmcpherson
Created January 3, 2013 00:38
Show Gist options
  • Save alexmcpherson/4439772 to your computer and use it in GitHub Desktop.
Save alexmcpherson/4439772 to your computer and use it in GitHub Desktop.
The fallout of the last Backbone View's render method
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