My HTML looks like this
<select ng-options="possibleConflict.id as possibleConflict.value for possibleConflict in possibleConflicts" ng-model="key"></select>
and the controller looks like this
app.controller('MainCtrl', function($scope) {
$scope.key = 2; // Note This value can change
$scope.possibleConflicts = [{
id: '1',
value: 'red'
}, {
id: '2',
value: 'blue'
}]
}
Here is a working Plunker example
Why isn't "red" selected as default when the page loads ? and how can I get it to be set as default ?
I have looked at this and this thread, but couldn't find a solution