Skip to content

Instantly share code, notes, and snippets.

@helielson
Last active December 20, 2015 17:39
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 helielson/6170138 to your computer and use it in GitHub Desktop.
Save helielson/6170138 to your computer and use it in GitHub Desktop.
{
"menu": {
"home": [
{
"label": "title1",
"iconClass": "icon1"
},
{
"label": "title2",
"iconClass": "icon2"
}
]
}
}
<script id="menu-item-template" type="text/x-handlebars-template">
{{#each menu}}
<nav class="{{@key}} current"> {{! it prints home }}
{{#each @key}} {{! this should iterate home, but doesnt works }}
<div class="menu-item">
<span class="icon {{iconClass}}"></span>
{{label}}
</div>
{{/each}}
</nav>
{{/each}}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment