I have two loop: one in the tr balise and another in the second td in the tr balise. I’ve looped enter image description hereselect inputs into td and i’d like to be able to retrieve the value of each select.
Typescript
`export class AddPlanningComponent {
selectedType: string[][] = [];`
Html
<tbody>
@for(agent of listAgents; track agent; let i= $index) {
<tr>
<td>
<h2 class="table-avatar">
<a class="avatar"><img alt="" src=""></a>
<a [routerLink]="">{{agent.prenom}} {{agent.nom}}</a>
</h2>
</td>
@for(item of daysArray; track item; let j = $index ) {
<td>
<mat-select [(ngModel)]="selectedType[i][j]" (ngModelChange)="setArrayPlanning(i, item, agent, j)" class="select custom-mat-select floating-mat-select">
<mat-option value="Matin">Matin</mat-option>
<mat-option value="Soir">Soir</mat-option>
</mat-select>
</td>
}
</tr>
}
</tbody>
New contributor
Maax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.