I have an array of objects and when i go to populate the select with the elements, it doesn't pre-select the currently active one. If i change the select it all works as intended, but the pre-selected element is not selected on page load.
JS:
$scope.license_year_list = [
{label:"Year of 1991", value:1991},
{label:"Year of 1992", value:1992} ];
$scope.item = {license_year: {label:"Year of 1992", value:1992}};
HTML:
<div ng-controller="MyCtrl">
<select ng-model="item.license_year"
ng-options="y.label for y in license_year_list">
</select>
</div>
Fiddle: http://jsfiddle.net/eXvH8/
y.label for y in license_year_list track by y.valuewould have worked too. And this could be used to directly work with the values.