Skip to content

Instantly share code, notes, and snippets.

@joachimhs
Created January 10, 2012 16:55
Show Gist options
  • Save joachimhs/1590003 to your computer and use it in GitHub Desktop.
Save joachimhs/1590003 to your computer and use it in GitHub Desktop.
ember.js metamorph
I have the following template:
<script type="text/x-handlebars" data-template-name="header-template">
<ul id="menu">
{{#each KR.MenuItemController.content }} <li><a href="#">{{ menuName }}</a>
{{#if hasSubItems}}
<ul>
{{#each subItems}}
<li><a href="#" onclick='KR.MenuItemController.set("clickedItem", {{ menuAction}})'>{{ menuName }}</a></li>
{{/each}}
</ul>
{{/if}}
</li>
{{/each}}
<li class="end">&nbsp;</li>
</ul>
</script>
And I want the link to read <a href="#" onclick="KR.MenuItemController.set('clickedItem', 'menuAction'>{{menuName}}</a>
But its written out with metamorphic scripts around the value. How can I format the {{bidnAttr }} so that it prints out the whole KR.MenuItemController.set... part ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment