Answer the question
In order to leave comments, you need to log in
How to remove extra option from select?
Good day!
I don't understand why this option appears.
I create:
<select ng-model="limit">
<option value="5" ng-selected="true">5</option>
<option value="10">10</option>
<option value="15">15</option>
</select>
$scope.limit = 5
<select ng-model="limit" class="ng-pristine ng-valid ng-touched">
<option value="? number:5 ?"></option>
<option value="5" ng-selected="true" selected="selected">5</option>
<option value="10">10</option>
<option value="15">15</option>
</select>
Answer the question
In order to leave comments, you need to log in
Try this with ng-options
<div ng-app>
<div ng-controller="TodoCtrl">
<select ng-options="value for value in limits" ng-model="limit">
</select><br/>
</div>
</div>
function TodoCtrl($scope) {
$scope.limits = [1,2,3,4,5];
$scope.limit = 3
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question