Created
July 15, 2012 09:28
-
-
Save glenjamin/3116057 to your computer and use it in GitHub Desktop.
Recursive render pseudo code
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
var root = template: "something", data: {}, children: {} | |
function render(obj) | |
partials = {} | |
for each name, child in obj.children | |
partials[name] = render(child) | |
return mustache(obj.template, obj.data, partials) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment