Seen a few options for filtering data via checkboxes but it all seems fairly overly complicated for something I\'d expect Angular to do easily.
Take a nose at http://pln
Here is a solution; showing diffs only:
In index.html modify the relevant lines as follows:
-
...
-
...
In script.js add:
$scope.checkbox = {};
var showAll = true;
$scope.searchByCheckbox = function(result) {
return showAll || $scope.checkbox[result.provider.providerId];
};
$scope.$watch("checkbox", function(newval, oldval) {
showAll = true;
angular.forEach($scope.checkbox, function(val) {
if( val === true ) showAll = false;
});
}, true);
(EDIT) Changed the key to $scope.checkbox
to providerId
. Filter starts disabled, so all entries are shown.
Good luck!