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

Ngmodel value is undefinied when the textbox's value is already given

$
0
0

@perenyitamas wrote:

I have a strange problem. I cannot upload my form’s values to a firebase database because some textboxes are undefinied.

I am loading the data into them from another page with callback via user interaction. What am i missing here? If i edit the textbox like adding an extra character to preloaded value is working normally.

html:

<ion-item>
      <ion-label fixed>Használt csali</ion-label>
      <ion-input [(ngModel)]="fogasCsali" type="text"></ion-input>
      <button ion-button clear item-end (click)="valasztasLadabolcsali()">
        <ion-icon name="add-circle">Választás ládából</ion-icon>
      </button>
    </ion-item>

ts class:

callback = data => {
    this.fogasCsali = data.csalineve;
  };

pushing to firebase:

 this.firebasedb.list("/fogasok/")
      .push({
        hasznaltcsali:this.fogasCsali,
      });

the user choose the value from another page:

  addFogashoz(item){

    this.navCtrl.pop().then(() => {
      this.navParams.get('callback')(item);
    });
  }

So basically if the user chooses the value i can see that in the textbox. However it is still undefinied and i have to write additional character to the textbox to get a value,

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70433

Trending Articles



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