Aparna Aparna - 1 year ago 106
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?

Answer Source

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;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download