Skip to content

Instantly share code, notes, and snippets.

@alexmcpherson
Last active December 10, 2015 14:08
Show Gist options
  • Save alexmcpherson/4445263 to your computer and use it in GitHub Desktop.
Save alexmcpherson/4445263 to your computer and use it in GitHub Desktop.
Another separation of concerns that's possible:
var MyView = Backbone.View.extend({
initialize: function() {
this.render();
this.model.on('change', this.update, this);
},
render: function() {
//Puts el on page, called ONLY once, by init
},
update: function() {
this.$el.html( /* Some template */ )
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment