<script>
var appMod = angular.module('myapp', []);
appMod.controller('myController', ['$scope', function($scope) {
$scope.DefaultOptions = ["First", "Second", "Third", "Fourth"];
}]);
</script>
<body ng-app="myapp" ng-controller="myController">
<div>
<select ng-options="o as o for o in DefaultOptions" ng-model="chosen"></select>
</div>
<div>
Chosen Value: <span ng-bind="chosen"></span>
</div>
</body>
Instructions:
1. In Chrome(not in Firefox!), select the dropdown with mouse and choose "First"
2. Then press downarrow.
3. Observe that the dropdown shows "Second" while the dynamically binded value still shows "Frist"
4. Press downarrow again.
5. Now both the select as well as binded field are showing "Third".
6. Clearly, there is some "magic" happening in angular with respect to second keydown event or is the ng-options used incorrectly here?
7. This happens always, even if you choose "Third" instead of "First" in first step.
Here is the plunker for the question in title.
http://embed.plnkr.co/x7dauZHIlriXpWd4kmgz/preview
Can someone please explain is this a bug in Angularjs or some problem in my usage of ng-options?
PS: I thought, of all the browsers, Chrome would be the nicest to Angularjs.