I'm filtering in my ng-options this is my code in my html
<select class="form-control" id="selectType" ng-model="user.type" ng-init="user.type= types[0]">
<option ng-repeat="type in types" value="{{type}}">{{type}}</option>
</select>
<select class="form-control" ng-model="user.fullname" ng-options="employee as fullName(employee) for employee in employees | filter: user.type">
then in my controller I have this code
$scope.types = ['admin','encoder','checker','cashier'];
var getEmployees = function () {
$http.get(httpHost + '/employees').success( function (data) {
if(data.length !== 0){
$scope.employees = $scope.sortData(data,'emp_fname');
$scope.user.fullname = $scope.employees[0];
console.log("Employees:");
console.log($scope.employees);
}else{
$scope.noEmployees = true;
}
}).error(function (err) {
console.log(err);
});
};
getEmployees();
it will filter it correctly but leave a blank in the first item in the dropdown my result is like this one http://jsfiddle.net/sheppe/EeL9y/