Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70443

Create a condition structure that takes the table information

$
0
0

@Ball4ckBR wrote:

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 });
    
 
}
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>