AngularJS - select tag - getting attribute from option when selected
问题 So I have a select tag that shows some options and I wish that when an option is selected it takes the data-something attribute and pastes its value (of the attribute) in the input element I have. It is only demonstrative, value attribute should be send 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>