What I’m trying to do is
<select value.bind="costing.item" matcher.bind="dictionaryItemMatcher">
<option repeat.for="item of dictionaryItems" model.bind="item">
<span if.bind="item.sector"> ${item.name} (${item.sector})</span>
<span else>${item.name}</span>
</option>
</select>
but it doesn’t seem that you can bind to the text of the <option>
I’ve also tried <option... value.bind="getText(item)">
and (out of desperation!)
<option if.bind="item.sector" repeat.for="item of dictionaryItems" model.bind="item">${item.name} (item.sector)</option>
<option else repeat.for="item of dictionaryItems" model.bind="item">${item.name}</option>
I finally arrived at the following which works, but it is very messy
<select class="custom-select" value.bind="costing.item" matcher.bind="dictionaryItemMatcher">
<option repeat.for="item of dictionaryItems" model.bind="item">${item.sector ? item.name + ' (' + item.sector + ')' : item.name}</option>
</select>
Is there a cleaner way to do this?