Reputation: 251
The selected
tag will not work because ng-model depends on ng-selected, how can I hardcode One
as my default selection here?
<div ng-app="myapp">
<fieldset ng-controller="FirstCtrl">
<select ng-model="selectedPerson">
<option selected value="1">One</option>
<option value="2">Two</option>
</select>
</fieldset>
</div>
Upvotes: 0
Views: 58
Reputation: 11398
You can remove the "selected" from your view
<div ng-app="myapp">
<fieldset ng-controller="FirstCtrl">
<select ng-model="selectedPerson">
<option value="1">One</option>
<option value="2">Two</option>
</select>
</fieldset>
</div>
Inside your controller, simply do the following :
$scope.selectedPerson = '1';
Upvotes: 1