Here is my HTML:
<tr *ngFor="let row of formData; let i = index" [attr.data-index]="i">
<td *ngFor="let rowdata of formData[i]; let j = index" [attr.data-index]="j">
<input type="checkbox" name="row-{{i}}-{{j}}" [(ngModel)]="formData[i][j]">
</td>
</tr>
As you can see I've set unique names on the checkboxes
to isolate them completely.
formData
follows a structure like this:
formData = [
[false, false],
[true, true],
[false, true]
]
The form populates correctly.
Checkboxes are generated correctly, however, there is some odd behavior :
When I click the checkbox for the first column, it also checks the box for second column ; this seems like total random behavior, but when I check a box for the second column, it has no affect on the checkbox for the first column
Any ideas why this is happening?
EDIT
Observation: I changed the input
to a standard input (not checkbox).
I changed the form values to "true", "false".. instead of true, false.
When I try to change the text in the input, I can only type one character and the input box "deselects" (i.e- I have to keep clicking on the input box to activate it every time I type a character)
EDIT
HTML Output as requested:
form
tag, do they need to be? – Foxhole