I want to reset selected options in select with custom value for options in angularJS :
HTML
<select id="" name="" class="form-control" ng-model="mymodel">
<option value="1000">All</option>
<option value="-1">Not Done Yet</option>
<option value="0">Already Done</option>
<option value="1">Other option1</option>
<option value="2">Other option1</option>
</select>
Select option is : <span>{{mymodel}}</span>
<button class="btn btn-danger glyphicon glyphicon-refresh"
data-toggle="tooltip" title="Reset"
ng-click="clearSearch();">Reset</button>
JS
$scope.clearSearch = function () {
$scope.mymodel = 1000;
}
If you're using AngularJS 1.4, you will need set values to a string instead of a number.
$scope.clearSearch = function () {
//Use a string
$scope.mymodel = '1000';
//Not a number
//$scope.mymodel = 1000;
}