. . checkAll .
HTML:
<div ng-app="listsModule">
<div ng-controller="listsController">
<input type="text" id="filter_lists" ng-model="search" placeholder="Search a list">
<table>
<thead>
<tr>
<th><input type="checkbox" ng-model="checkAll"/></th>
<th>List name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="list in filtered = (lists | filter:{name:search}) | orderBy:'name'">
<td><input type="checkbox" ng-model="list.isSelected"></td>
<td>{{ list.name }}</td>
<td>{{ list.isSelected }}</td>
</tr>
</tbody>
</table>
<div>Selected:
<div ng-repeat="list in filtered | filter:{isSelected:true} | orderBy:'name'">
{{list.name}}
</div>
</div>
</div>
</div>
JavaScript:
var app = angular.module("listsModule", []);
app.controller('listsController', ['$scope', function($scope) {
$scope.lists = [
{"id": 39, "name": "Fluffy", "isSelected": false},
{"id": 40, "name": "Muffy", "isSelected": false},
{"id": 41, "name": "Dingo Jr.", "isSelected": false},
{"id": 42, "name": "Bertram", "isSelected": false}
];
$scope.$watch('checkAll', function(newValue, oldValue) {
if ($scope.filtered)
for (i=0; i<$scope.filtered.length; i++) {
$scope.filtered[i].isSelected = newValue;
}
});
}]);