From the Docs:
Note: ngSelected
does not interact with the select
and ngModel
directives, it only sets the selected
attribute on the element. If you are using ngModel
on the select, you should not use ngSelected
on the options, as ngModel
will set the select value and selected options.
— AngularJS ng-selected Directive API Reference
The ng-value
directive is in the wrong place:
<md-input-container flex>
<label>Anno selezione</label>
<md-select name="annoSelect" ng-model="vm.anno_attuale"
?n?g?-?v?a?l?u?e?=?"?v?m?.?p?r?o?g?e?t?t?o?.?p?p?r?s?[?$?i?n?d?e?x?]?.?a?n?n?o?"?
?n?g?-?s?e?l?e?c?t?e?d?=?"?i?t?e?m?.?s?e?l?e?c?t?e?d?"? ? >
<md-option ng-repeat="item in vm.progetto.pprs"
ng-value="item.anno">
?{?{?v?m?.?p?r?o?g?e?t?t?o?.?p?p?r?s?[?$?i?n?d?e?x?]?.?a?n?n?o?}?}?
{{item.anno}}
</md-option>
</md-select>
</md-input-container>
For more information, see Using ngValue
to bind the model to an array of objects
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…