I want to display a list of items in a table and allow users to filter the items using form controls.
My Problem
I am able to accomplish this when t
angular can automatically two-way-bind everything for you without the need for filters:
JS:
$scope.filteredRecords = function() {
return $scope.records.filter(function(record, i) {
return record.travelerCount === $scope.travelerFilter &&
record.group === $scope.groupFilter;
});
}
HTML:
See here for a live example: http://plnkr.co/edit/aeBv2soGG06Trpp9WI4f?p=preview
- 热议问题