Skip to content

Instantly share code, notes, and snippets.

@garbados
Created January 10, 2013 03:17
Show Gist options
  • Save garbados/4499137 to your computer and use it in GitHub Desktop.
Save garbados/4499137 to your computer and use it in GitHub Desktop.
Backbone DummyView: takes a template and an el and shoves it into the DOM upon instantiation.
var DummyView = Backbone.View.extend({
initialize: function(options) {
this.template = _.template(options.template.html());
this.render();
},
render: function() {
this.$el.html(this.template({}));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment