Dynamically adding ion-input items and getting the data dynamically

Is there a way to dynamically create “ion-input” items and to use the data. I need to create a
variable number of "ion-input"s based on an array. The creation is actually easy:

<ion-item *ngFor="let att of this.anArray; let idx = index">
    <ion-label color="primary">{{att[0]}}</ion-label>
    <ion-input *ngIf="att[1] == 'string'" [(ngModel)]="this.modelNames[idx]" text-right value=""></ion-input>
    <ion-datetime *ngIf="att[1] == 'year'" displayFormat="YYYY"  [(ngModel)]="this.modelNames[idx]"></ion-datetime>
</ion-item>

modelNames[idx] are unique names. They correpondent with “anArray”.But how can i pass the data of the dynamically created formular-items to a function. Normally i would do something like that:

<button ion-button full  (click)="goTo(aModel, anotherModel)">let's go</button>

but as you can see, i can’t do this in this case. Maybe i can call every time a function, when something is changed with “ionChange”, and fill some array and uses it later ? Is there a way to perform this task elegantly ?

I would look at using reactive forms here.

I think, i didn’t grasp the concept of the two way data-binding of angular. To save the selected values i can use some variables i declared in the ts-file. In my case i use an array. so i don’t need to pass the data to a function. i can just call the function and it has already the data (stored in that array).