I'm having trouble with binding and synchronizing select elements. I am trying to make two select elements work together, but using ng-value="$index" doesn't seem to be doing the trick.
These are in sync:
<select ng-model="myVar1"><option value="{{n}}" ng-repeat="(n, o) in ['donny', 'felix', 'bob'] track by $index" >{{o}}</option></select>
{{o}}
However, these do not synchronize:
<select ng-model="myVar2"><option ng-value="$index" ng-repeat="o in ['donny', 'felix', 'bob'] track by $index" >{{o}}</option></select> <select ng-model="myVar2"> <option ng-value="$index" ng-repeat="o in ['donny', 'felix', 'bob'] track by $index" >{{o}}</option> </select>
JSBIN: http://jsbin.com/dirugikice/1/edit?html,js,output
Can anyone help me figure out what I am missing?