Last active
December 10, 2015 13:18
-
-
Save alexmcpherson/4439627 to your computer and use it in GitHub Desktop.
A typical implementation of a 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() {}, | |
render: function() { | |
// Put content into the el | |
this.$el.append( /* some HTML */ ); | |
// Put the el onto the page | |
$('#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