mardi 19 février 2019

Count selected checkboxes without event (Angular)

Is it possible to count selected checkboxes without firing an event?

I have a dynamic list of items and want to show the user the total number selected, live.

<div *ngFor="let item of items; let i = index" class="form-check">
 <input type="checkbox" class="form-check-input" id="itemCheck" name="item"[(ngModel)]="item.checked" />
  <label class="form-check-label" for="itemCheck"></label>
</div>



The answers I've seen have been event based.




Aucun commentaire:

Enregistrer un commentaire