Created
January 10, 2013 03:17
-
-
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.
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 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