here is my JSON
[{
"id": 138,
"first_name": "John",
"last_name": "Doe",
"phone": [{
"label": "home",
"value": 546345
}, {
"label": "wife",
"value": 63456345
}]
}]
I need to make edit form when I click on edit show input field. I get everything to work, but for the phone number I get a problem, I can not get input for all object in contact_phone, only for first object.
Here is part of my code
<div formArrayName="phone">
<div *ngFor="let number of phoneFormGroup.controls; let i = index">
<div [formGroupName]="i" class="row">
<div class="col-xl-5 col-md-5 col-sm-12 col-12">
<input formControlName="value" type="number" placeholder="Number" />
</div>
<div class="col-xl-5 col-md-5 col-sm-12 col-10">
<input formControlName="label" type="text" placeholder="Label" />
</div>
<div class="col-xl-2 col-md-2 col-sm-12 col-2 newContactInputTitle">
<div class="removeNumber" (click)="removeNumber(i)"><i class="fa fa-times"></i></div>
</div>
</div>
</div>
<div class="addNumber d-flex h-100r" (click)="addNumber()"><i class="fa fa-plus-circle fa-2x" aria-hidden="true"></i>Add number</div>
</div>