I have a set of data with attributes such as name, year, height, weight and sport. There will be two or more sport types in my data, and I would like to be able to narrow down the result of ng-repeat using checkboxes as well as a text search. As an angular noob I'm having trouble setting this up. The working code I have so far is pretty minimal. Is there a simple way of doing this? Is there a simple way of making this work with just two sports? (The two checkboxes are not currently linked to anything, they are just examples of the current html).
index.html
<div ng-controller="controller">
<input class="p-search" ng-model="query" placeholder="search anything">
<input class="sport-toggle baseball" type="checkbox" checked>
<input class="sport-toggle football" type="checkbox" checked>
<div class="player-card" ng-repeat="player in roster | filter: query">
<div>player {{info}}</div>
</div>
</div>
controller.js
var rosterfy = angular.module('rosterfy', []);
rosterfy.controller('controller', function controller($scope) {
$scope.roster = [
{
...a bunch of json data....
}
];
});