I want to bind my dynamic input fields with ionic html template.
home.html
<form [formGroup]="clientForm">
<ion-item *ngFor="let obj of clientForm.controls.assign_array.controls;let z=index">
<ion-input placeholder="Type dat" type="text"></ion-input>
</ion-item>
</form>
home.ts
constructor(){
this.clientForm = this._fb.group({
assign_array: this._fb.array([])
});
}
On save click:
btnClick(){
console.log("clintform--- " + JSON.stringify(this.clientForm.value));
}
Output: { "assign_array":[ "", "", "" ] }
I can see multiple input fields in my app, but when i type something to each field my log doesn't show the value of assign_array
fields
Where i am making mistake?
Thank you in advance!