I am using angular2 and in my forms I usually create a model class and bind my object with the form then access is via this.myObject.
<div class="form-group ">
<label class="col-md-3 control-label">Label</label>
<div class="col-md-6">
<input type="text" class="form-control" [(ngModel)]="diplome.label" name="label">
</div>
</div>
And get my data later
private diplome = new Diplome();
let myData = this.diplome;
I am now on a position when I show an array of data using *ngFor, and I want when clicking on submit to get all of them as an array of a specific class.
...
<tr *ngFor="let inscription of inscriptions">
<td>
<span *ngIf="inscription._etudiant">{{ inscription._etudiant.label }}</span>
</td>
<td>
<div class="form-group ">
<div class="col-md-6">
<input type="number" class="form-control" name="note">
</div>
</div>
</td>
</tr>
...
I want to be able to get in every iteration the inscription object with the data being inserted into the input using binding.