I have a ng-options, an array and a default ng-options-model of 0, ie the first element in the array. Why is the first name in the array shown in the dropdown (it is only blank)?
See plunk.
I have this html:
<form>
<select ng-options="index as contact.name for (index,contact) in contacts" ng-model="selectedContact"></select>
</form>
Selected contact array index (default 0): {{selectedContact}}
And this controller:
app.controller('MyCtrl', ['$scope', function ($scope) {
$scope.contacts = [
{email: "[email protected]", name: "Mini Me"},
{email: "[email protected]", name: "Maxi You"}
];
$scope.selectedContact = 0;
}]);