Your HTML renders like below on View
<select ng-model="employeeFilter" style="width: 100px;" class="ng-pristine ng-valid">
<option value="? string: ?"></option>
<option value="7" class="ng-scope ng-binding">Jamie</option>
<option value="37" class="ng-scope ng-binding">Anne</option>
<option value="8" class="ng-scope ng-binding">James</option>
</select>
In which value of employeeFilter
means the option value of select box which are present in ""
like value="7"
for Jamie.
You are mentioning true
in your filter, that means you're making strongly type check.
In this case 7==="7"
is not true. Therefore you need to parse
the variable to integer
before filtering, after parsing "7"
will become 7
you will get expected result like 7===7
//will become true
HTML
<select ng-model="employeeFilter" style="width: 100px;">
<option data-ng-repeat="employee in employeesFilterList" value="{{employee.id}}">{{employee.username}}</option>
</select>
Controller
$scope.doParseInt = function(val){
if(val && val != "")
return parseInt(val)
}
Working Fiddle
This could be helpful to you. Thanks.