JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js"></script>
<body ng-app>
<div ng-controller="Ctrl">
<select ng-model="employeeFilter" style="width: 100px;">
<option data-ng-repeat="employee in employeesFilterList" value="{{employee.id}}">{{employee.username}}</option>
</select>
<ul>
<li ng-repeat="worktime in worktimes = (worktimes | filter:{ employeeId : doParseInt(employeeFilter) }:true)">{{worktime.customerName}}</li>
</ul>
</div>
</body>
JavaScript
function Ctrl($scope) {
$scope.employeesFilterList = [
{"id":7,"username":"Jamie",},
{"id":37,"username":"Anne",},
{"id":8,"username":"James",}
];
$scope.doParseInt = function(val){
if(val && val != "")
return parseInt(val)
}
$scope.worktimes = [ {
"workTimeId" : 1,
"customerId" : 1,
"customerName":"PĂĽschel Media AB",
"employeeName":"Brett",
"employeeId":7,
"projectId": 1,
"projectName":"Project 1",
"timeType": "100%",
"startDate":"2015-01-22",
"endDate":"2015-01-23",
"startTime":"17:06:00",
"endTime":"19:10:00",
"totalTime":"2 h 1 min",
"includeOnInvoice" : "0",
"invoiceId" : 4
},
{
"customerId" : 2,
"customerName":"Clean Combustion",
"employeeName":"Steven",
"employeeId":37,
"projectId": 2,
"projectName":"Project 2",
"timeType": "0%",
"startDate":"2014-01-22",
"endDate":"2014-01-22",
"startTime":"17:06:00",
"endTime":"21:10:00",
"totalTime":"3 h 21 min",
"includeOnInvoice" : "1",
"invoiceId" : 2
},
{
"customerId" : 3,
"customerName":"Forsmark Kraftgrupp AB",
"employeeName":"Jim",
"employeeId":8,
"projectId": 3,
"projectName":"Project 3",
"timeType": "Resa",
"startDate":"2015-01-12",
"endDate":"2015-01-12",
"startTime":"17:06:00",
"endTime":"21:10:00",
"totalTime":"2 h 59 min",
"includeOnInvoice" : "1",
"invoiceId" : 3
}];
$scope.employeeFilter = '';
}