Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div data-ng-repeat="cust in customers">
- <input type="checkbox" data-ng-model="search.city" data-ng-true-value="{{ cust.city }}" data-ng-false-value=""/> {{ cust.city }}
- </div>
- <table>
- <!-- table heading goes here -->
- <tbody>
- <tr data-ng-repeat="customer in customers | filter : search">
- <td >
- {{ customer.firstName }}
- </td>
- <td >
- {{ customer.lastName }}
- </td>
- <td >
- {{ customer.address }}
- </td>
- <td >
- {{ customer.city }}
- </td>
- </tr>
- </tbody>
- </table>
- <input type="checkbox" ng-model="search[cust.city]" /> {{ cust.city }}
- <tr data-ng-repeat="customer in customers | filter:searchBy() ">
- function ctrl($scope) {
- $scope.customers = [...];
- $scope.search = {};
- $scope.searchBy = function () {
- return function (customer) {
- if ( $scope.search[customer.city] === true ) {
- return true;
- }
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement