I have a select tag that displays options, and I want it so that when an option is selected, the value of the data-something
attribute is copied into the input element. This is just for demonstration purposes; the actual value should be sent in the form.
<input ng-model="refreshedByExample" type="text">
<select ng-model="example">
<option value="1" data-something="valueForRefreshedByExample1">1</option>
<option value="2" data-something="valueForRefreshedByExample2">2</option>
<option value="3" data-something="valueForRefreshedByExample3">3</option>
</select>
Any suggestions on how to achieve this?
Thank you in advance!