Dear
Here it is just help ref. to your question. I gave a script to select all the records . Therefore, modify it as you wish.
<button ng-click="selectAll()">select all</button> <div ng-repeat="item in items"> <label> {{item.n}}: <input type="checkbox" ng-model="selected[item.id]"> </label> </div>
And in the controller, just set all elements to true:
$scope.selected = {}; $scope.selectAll = function(){ for (var i = 0; i < $scope.items.length; i++) { var item = $scope.items[i]; $scope.selected[item.id] = true; } };
Thanks and greetings
source share