I have the following in my template:
<select>
{{#each sortedManufacturers key="id" as |manufacturer|}}
<optgroup label="{{manufacturer.name}}">
{{#each manufacturer.cars key="id" as |car|}}
<option {{action "carSelected" car}} value="{{car.model}}">{{car.model}}</option>
{{/each}}
</optgroup>
{{/each}}
</select>
In the controller, I have:
actions: {
carSelected(car) {
console.log(car);
}
}
When the option is selected from the select
. It doesn't seem to trigger the carSelected
action.
Any ideas why?
Aucun commentaire:
Enregistrer un commentaire