Created
July 14, 2012 18:45
-
-
Save stephenmelrose/3112637 to your computer and use it in GitHub Desktop.
Hogan and Partials
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 hogan = require('hogan.js'); | |
var partial = hogan.compile('{{#list}}{{foo}}{{/list}}'); | |
var template = hogan.compile('{{> somelist}}'); | |
var result = template.render( | |
{ | |
list: [ | |
{ foo: 'bar1' }, | |
{ foo: 'bar2' }, | |
{ foo: 'bar3' } | |
] | |
}, | |
{ somelist: partial } | |
); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment