I have a select element inside the loop, and the action I want to start must have two parameters: the selected parameter of the select element and the element we are looping. My code looks like this:
{{#each loopItems as |loopItem|}}
<select onChange={{action 'fireThis' loopItem target.value }}>
{{#each loopItem.subItems as |subItem|}}
<option value={{subItem.id}}>{{subItem.value}}</option>
{{/each}}
</select>
{{/each}}
And my fireThis action looks like this:
fireThis:function(loopItem, value){
}
Thus, in my particular case, the number of subtypes is dynamic, and I need to use the selected subItem with the loopItem element that it is currently located.
Prohibition of reorganization into components (right now, I can’t do this), how would I pass more than one parameter to an action running on 'onChange'?
I tried:
<select onChange={{action 'fireThis' value ="loopItem target.value" }}>
<select onChange={{action 'fireThis' value ="loopItem target.value" }}>
<select onChange={{action 'fireThis' loopItem value="target.value"}}>
<select onChange={{action 'fireThis' value="target.value" loopItem}}>
undefined ( ). , :
<select onChange={{action 'fireThis' value="target.value"}}>
subItem, loopItem.
, loopItems Ember Objects, ID, . .