I would like to use the index of the iterate loop in the HTML as a value, as in:
<select bind-value="gAddItem.drawType"
template iterate="int ind = 0; ind < gDrawDescs.length; ind++">
<option value="{{ind.toString()}}"> {{gDrawDescs[ind]}} </option>
</select>
But this intuitive syntax doesn’t seem to work. Is there a way to do this in Dart Web-ui?
Dart doesn’t seem to allow list range literals, which would allow the neat solution:
To get around this, create the following function:
And in the HTML: