I'm looking to add input field dynamically, is it possible? someone has example how to do that? For example when i choose from my select options 2 input field it shows me and one i choose 5 input fields it shows me 5 input fields
I thought to do something like that
<ion-item>
<ion-label fixed>Field 1</ion-label>
<ion-input type="text" value=""></ion-input>
</ion-item>
<ion-item *ngIf="someVariable === 'value1'">
<ion-label fixed>Field 2</ion-label>
<ion-input type="text" value=""></ion-input>
</ion-item>
</ion-list>
Then i bind select to someVariable:
<ion-item>
<ion-label>Options</ion-label>
<ion-select [(ngModel)]="someVariable">
<ion-option value="value1" selected="true">Option 1</ion-option>
<ion-option value="value2">Option 2</ion-option>
</ion-select>
</ion-item>
that's good but let's suppose i have 8 options and if user choose option 5 so it shows his 5 input fields, how can i do that? in addition if i do that, i need to declare variables dynamically because option 5 value i need to assign to specific variable.