The whole point of Angular (or other MVVM frameworks) is that you can justify its ViewModel conditions and associate the View View with it.
This means that if you need to select something or some preset <input type="checkbox"> , just assign the desired ViewModel state.
In your case, assign mySelect to what you need so that the default ViewModel is assigned. And a presentation will follow.
$scope.myData = ['a','b','c']; $scope.mySelect = $scope.myData[$scope.myData.length - 1]; // last value
<select ng-model="mySelect"> <option ng-repeat="item in myData" value="item">{{item}}</option> </select>
Not related to the question, but it is better to use ng-options instead of ng-repeat , but the same idea applies:
<select ng-model="mySelect" ng-options="item for item in myData"> </select>
Just using ng-selected does not change the underlying model, which is ultimately important in an Angular application.
source share