I would like to select all the checkboxes in Angular, where I have ngFor and ngIf when activating "Seleccionar todo (Select all)" and all the checkboxes of months are activated. The months are stored in an array.
<div class="form-group row">
<label class="col-2 col-form-label">Meses de siembra</label>
<div class="col-8">
<table>
<tr>
<label>
<input type="checkbox" ng-model name="seleccionarTodo"> Seleccionar todo
</label>
</tr>
<tr>
<td>
<div *ngFor="let m of mesesSiembra; let i=index">
<label *ngIf="i<6">
<input type="checkbox" ng-model name="mes1a6">
</label>
</div>
</td>
<td>
<div *ngFor="let m of mesesSiembra; let i=index">
<label *ngIf="i>5">
<input type="checkbox" ng-model name="mes7a12">
</label>
</div>
</td>
</tr>
</table>
</div>
</div>
Aucun commentaire:
Enregistrer un commentaire