javascript - calculate number of checked checkbox in angularjs -
i try display how many checked checkboxes using code
<li class="list-group-item" ng-repeat="user in data"> <input type="checkbox" ng-model="user.checked"/> {{user.name}} </li> <p>total checked: {{user.checked.length}}</p>
i tried count() within {{}} doesn't work.
you should filter users checked
property:
<p>total checked: {{ (data | filter:{checked: true }).length }}</p>
Comments
Post a Comment