Enable/Disable button in AngularJS

I have a table that has a checkbox. It has a select ALL javascript function and a select one by one function. My html file looks like this for the delete button:

<button data-toggle="modal" data-target="#rejectModal" contenteditable="false" id="delbutton" ng-model="delbutton" ng-disabled="countChecked() == 0">Delete</span></button>

Select All Checkbox:

<th class="">
    <input type="checkbox" name="select" id="checkAll" ng-model="selectAllRawSCP"/>
</th>

table details:

<tr ng-repeat=" item in rawSCAP | orderBy:sort">
   <td>
        <input type="checkbox" name="select" value="checked" ng-model="item.checked"/>
    </td>

I used the code I saw in one of the answers here in stack overflow to disable the delete button if there is no checkbox checked. It looks like this:

$scope.countChecked = function(){
            var count = 0;
            angular.forEach($scope.rawSCAP, function(value){
                if (value.checked) count++;
            });

            return count;
        }

But using this, my page returns an error which isTypeError: Cannot read property ‘checked’ of null
Error

And also I need to enable delete button even if I used select all

Source: AngularJS