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.

demo plunker

you should filter users checked property:

<p>total checked: {{ (data | filter:{checked: true }).length }}</p> 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -