Skip to content

Instantly share code, notes, and snippets.

@kahwee
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kahwee/194a042ad16f066d3fca to your computer and use it in GitHub Desktop.
Save kahwee/194a042ad16f066d3fca to your computer and use it in GitHub Desktop.
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