get count of items with some property in an array

There is another way to do this: the AngularJS filters.
You can write this:

var selectedCount = $filter('filter')($scope.students, { isSelected: true }).length;

Leave a Comment