Last active
December 12, 2015 12:09
-
-
Save 1Marc/4770143 to your computer and use it in GitHub Desktop.
Pseudocode demonstrating pre-rendering HTML and binding views to it rather than the views generating HTML.
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
// Pseudocode demonstrating pre-rendering HTML | |
// Binding views to HTML rather than the views generating HTML | |
var $listItems = $('#list').find('li'); | |
var dataset = data; // array of 1000 objects | |
for (var i = 0; i < dataset.length; i++) { | |
var view = new ItemView({model: dataset[i]}); | |
view.setElement($listItems.eq(i)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment