I have a question about creating a reusable select input that displays a 'Charging ...' message while waiting for options to load via an ajax request. Is there a way to achieve this using a directive like 'ajax-charged'?
For example, I would like to use the following HTML in my views:
<select ng-options="opt in options" ajax-charged>
<option>Charging ... </option>
</select>
Once the options are loaded, the HTML would become:
<select ng-options="opt in options" ajax-charged>
<option>opt1</option>
<option>opt2</option>
<option>etc</option>
</select>
I'm considering changing the options array to include only a 'Charging ...' item, but I am open to other suggestions for achieving reusability. Any ideas?