This snippet is a key part of my component's template:
{{#each displayResults}}
<li {{action addSelection this}} {{bindAttr class=\":result active\"}}>
{{#if controller.template}}
{{yield}}
{{else}}
<span class=\"result-name\">{{displayHelper controller.searchPath}}</span>
{{/if}}
<\/li>
{{/each}}
I am looking to give users the ability to personalize the HTML used for displaying results.
The issue arises when {{yield}} is called within an {{#each}} helper. For example, if the component is instantiated like this:
{{#auto-suggest source=controller.employees destination=controller.chosenEmployees}}
<span class=\"result-name\"><img src="img/small_avatar.png"/>{{fullName}}</span>
{{/auto-suggest}}
Then the content inside the {{#auto-suggest}} block does not have access to the context of the {{#each}} helper in the component.
Is there a workaround for this limitation, or is it simply the nature of the component?