I have an array of objects as follow.
$scope.students = [{\'isSelected\': true}, {\'isSelected\': true}, {\'isSelected\': false}, {\'isSelected\':
There is another way to do this: the AngularJS filters. You can write this:
var selectedCount = $filter('filter')($scope.students, { isSelected: true }).length;