I get response from an API that incorporates, nested array of objects in the following way.
var virtualAddrObjFinal = [
{
"accountNo": "5019000",
"vpainfo": [
{
"vpa": "newq@bandhan"
},
{
"vpa": "log@bandhan"
}
]
},
{
"accountNo": "1018000",
"vpainfo": [
{
"vpa": "newesaf@bandhan"
}
]
}
]
And want to populate the values in dropdown using vpainfo
object. Here am having issue with the nested object. Can any one suggest the way to achieve this.
I have tried the below way,
<ion-select [formControl]="vaddr" (ionChange)="fetchVPAAccountNumber($event)" interface="popover">
<ion-option *ngFor="let vaddrlist of virtualAddrObjFinal.vpainfo;let i = index" [value]="vaddrlist">{{vaddrlist.vpa}}
</ion-option>
</ion-select>
And need to show the accountNo
after selecting the specific vpa
.