Last active
August 29, 2015 14:02
-
-
Save kahwee/194a042ad16f066d3fca to your computer and use it in GitHub Desktop.
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 template2 = Handlebars.compile('{{#each company}}{{#each employee}}{{@key}}{{@../index}}\n{{this}}\n\n{{/each}}{{/each}}'); | |
/* | |
Return-- | |
Tremor Video0 | |
X | |
Tremor Video0 | |
Y | |
Microsoft1 | |
Satya Nadella | |
Google2 | |
Larry Page | |
*/ | |
console.log(template2({ | |
company: { | |
'Tremor Video': { | |
employee: [ | |
'X', | |
'Y' | |
] | |
}, | |
'Microsoft': { | |
employee: [ | |
'Satya Nadella' | |
] | |
}, | |
'Google': { | |
employee: [ | |
'Larry Page' | |
] | |
} | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment