Currently I am working with Angular 2.0 and have an array named addExtra: number[] = [0,1,2,3];
.
This is the HTML code I am using:
<div *ngFor="let val of addExtra">
<div class="row">
<div style="margin-left:15px;">
<button class="btn btn-danger btn-delete"
(click)='delete(val)'>
<i class="fa fa-times" aria-hidden="true"></i>
</button>
<label for="isCheckBox">Draw</label>
<input id=val type="checkbox" class="setCheckbox" (change)="isChecked($event)" style="vertical-align: text-bottom;" />
</div>
</div>
</div>
I want to know how to assign 0, 1, 2, 3 as ids to the checkboxes based on the values of the array.