I need to make that if the person enters a CEP that is already in the table automatically the other fields will be filled with the information that was placed in this CEP.
home.page.html:
<ion-item>
<ion-grid>
<ion-row>
<ion-col>
CEP
</ion-col>
<ion-col>
Endereço
</ion-col>
<ion-col>
Cidade
</ion-col>
<ion-col>
UF
</ion-col>
</ion-row>
<ion-row *ngFor="let campo of campos; let i=index">
<ion-col>
{{campo.cep}}
</ion-col>
<ion-col>
{{campo.endereco}}
</ion-col>
<ion-col>
{{campo.cidade}}
</ion-col>
<ion-col>
{{campo.uf}}
</ion-col>
</ion-row>
</ion-grid>
home.page.ts:
export class HomePage {
public cep;
public endereco;
public cidade;
public uf;
public campo;
public campos = [{cep: '5555',
endereco:'99999', cidade: 'Itapeva', uf: 'SP'}
];
adicionar():void{
var campos1 = this.campos.push({cep: this.cep, endereco: this.endereco, cidade: this.cidade, uf: this.uf });
}
}