Here is the custom-element:
<template bindable="menuItem">
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
${menuItem} <span class="caret">
</span></a>
<ul repeat.for="navModel of menuItem.navModels" class="dropdown-menu">
<li><a href.bind="navModel.href">${navModel.name}</a></li>
</ul>
</template>
and here is how I am calling it:
<template>
<require from="./menu-bar-dd-item.html"></require>
<require from="./menu-bar-link-item.html"></require>
<ul class="nav navbar-nav">
<li class="${menuItem.navModels ? 'dropdown' : navModel.isActive ? 'active' : ''}" repeat.for="menuItem of menuItems">
<menu-bar-link-item if.one-time="!menuItem.navModels" nav-model="menuItem" ></menu-bar-link-item>
<menu-bar-dd-item if.one-time="menuItem.navModels" menu-item="menuItem" ></menu-bar-dd-item>
</li>
</ul>
</template>
The issue is that in the custom-element the binding ${menuItem} is evaluating to the string 'menuItem'. It looks like menuItem is just null inside the template (because the for loop also has no iterations even though the menuItem being passed in has multiple navModels). It looks like somehow the menuItem is not being bound into the component.
menu-item.bind="menuItem"
- Fabio Luz<taco></taco>
- Fabio Luz