Using track by
in ng-options
causes Angular to not update the selectbox value immediately, even after a selection is made. It seems to work correctly on the second try, even when the model value is already set.
var myapp = angular.module('myapp', []);
myapp.controller('FirstCtrl', function ($scope) {
$scope.items = [
['ali', 'ali']
];
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"></script>
<div ng-app="myapp">
<fieldset ng-controller="FirstCtrl">
value: {{selected}} <br><br>
<select
ng-options="item[0] as item[1] for item in items track by item[0]"
ng-model="selected"></select>
</fieldset>
</div>