From the Docs:
Note:
ngSelected
does not interact with theselect
andngModel
directives, it only sets theselected
attribute on the element. If you are usingngModel
on the select, you should not usengSelected
on the options, asngModel
will set the select value and selected options.
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