Created
November 19, 2014 20:15
-
-
Save arbaaz/ac531691506ea88d0123 to your computer and use it in GitHub Desktop.
backbone render optimised
This file contains hidden or 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
render: function() { | |
this.$el.empty(); | |
var container = document.createDocumentFragment(); | |
// render each subview, appending to our root element | |
_.each(this._views, function(subview) { | |
container.appendChild(subview.render().el); | |
}); | |
this.$el.append(container); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment