Ionic - Condition in which if the field already exists it will be added again

Asked

Viewed 33 times

1

I have a question on Ionic, I’m trying to do that if the field that would be the zip code is already in the table it will automatically fill the rest with what has already been typed in this zip code.

Home.pagets.

export class HomePage {
  public cep;
  public endereco;
  public cidade;
  public uf;
  public campos =  [{cep: '5555',
  endereco:'99999', cidade: 'Itapeva', uf: 'SP'}
  ];


  adicionar():void{
    this.campos.push({cep: this.cep, endereco: this.endereco, cidade: this.cidade, uf: this.uf });
    
  }
}

  • If you use Formgroup and Formbuilder, this action will be possible. Any questions I can post a code to help you.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.