There is another way to do this: the AngularJS filters.
You can write this:
var selectedCount = $filter('filter')($scope.students, { isSelected: true }).length;
More Related Contents:
- AngularJS routing without the hash ‘#’
- AngularJS passing data to $http.get request
- Angular IE Caching issue for $http
- How to add many functions in ONE ng-click?
- How to reload or re-render the entire page using AngularJS
- How to find a reason AngularJS “Argument ‘MyCtrl’ is not a function, got undefined”
- orderBy multiple fields in Angular
- AngularJS – Image “onload” event
- $watch an object
- ngRepeat Filter by deep property
- Composing multipart/form-data with a different Content-Type on each parts with Javascript (or Angular)
- Update parent scope variable in AngularJS
- How to render html with AngularJS templates
- Problems downloading big file(max 15 mb) on google chrome
- Download text/csv content as files from server in Angular
- How do I get basic auth working in angularjs?
- How to make a jsonp request
- Angular-UI Router: Nested Views Not Working
- JavaScript: Remove duplicates of objects sharing same property value
- Can an angular directive pass arguments to functions in expressions specified in the directive’s attributes?
- How do I configure different environments in Angular.js?
- Share a single service between multiple angular.js apps
- Directing the user to a child state when they are transitioning to its parent state using UI-Router
- ng-repeat with ng-transclude inside a directive
- Using Express Handlebars and Angular JS
- apply formatting filter dynamically in a ng-repeat
- angularjs custom filter to check for values inside a data array
- AngularJS application file structure
- Validate phone number using angular js
- How is AngularJS different from jQuery