Using Angular 1.2.29, when I create <select>with ng-options, it appears on the surface to work as expected, when I select an option, the model is updated, and visually <select>indicates that a new option is selected.
However, when using the developer tools to view the markup, I see that the parameter tags are not updated, especially the attribute is selectednot removed from the previously selected parameter and is not added to the newly selected parameter.
<div data-ng-controller="MainController as main">
<pre> {{ main.test.item }} </pre>
<select
data-ng-model="main.test.item"
data-ng-options="item.label for item in main.test.items"
required="required">
<option value="" label="What do you want?"></option>
</select>
</div>
this.test.item selected="selected" ( "B" ), ( ) .
angular
.module('myApp')
.controller('MainController', MainController);
function MainController () {
this.test = {};
this.test.items = [
{ label : 'A' },
{ label : 'B' },
{ label : 'C' }
];
this.test.item = this.test.items[1];
}
, , ?
, , ?
https://jsfiddle.net/paulhhowells/4hmwhbe8/