Aparna Aparna - 7 months ago 55
AngularJS Question

Select All Checkbox scope variable not getting set

I want to implement the functionality of "select All" checkbox should get selected when we select all the sub-items.

Here is the plnkr.

why the "select All" model is not getting set?


Change your select method to this:

$scope.select = function(){
    angular.forEach($scope.friends, function (item) {
        if(!item.Selected){ // uncheck 'all' if any item is not selected
            $scope.selectedAll = false;