I need help displaying the count of a list of checkboxes into the value of a dropdown box. Where do I need to get my count from? The checkboxes are being passed dynamically as an array.
Here is my current code.
DropDownBox Component
<div ngbDropdown class="d-inline-block" [autoClose]="false"> <button class="btn btn-outline-primary" id="dropdownMenu1" ngbDropdownToggle(need to display the count here) </button> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <input type="text" placeholder="" class="searchBox" /> <div *ngFor="let data of datas"> <cst-checkbox [checkBoxValue] = "data" [ngModel]="data.selected"></cst-checkbox> </div> </div> </div>
Checkbox component
<div class="checkbox"> <input type="checkbox" value="" /> <label></label>
</div>
The checkbox component is <cst-checkbox> in the dropdown component.
Aucun commentaire:
Enregistrer un commentaire