Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49253

Get input datas from html to .ts

$
0
0

@jagerOrNot wrote:

Hi,
I have a little problem with my code,
i have to save datas written by the user but i can’t get it.

In this kind of input:

        <ion-item>
          <ion-label stacked>First Name</ion-label>
          <ion-input type="text" aria-placeholder="First Name" placeholder="First Name" [(ngModel)]="firstName" name="firstName"></ion-input>
        </ion-item>

And my .ts:

firstName = ' ';
public qObj = {
  firstName: this.firstName,
};

When the user press the button “SAVE” the variable into the qObj is ’ ’ not the name he wrote…

I don’t know how should i do…

Thanks for your time !

Posts: 4

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 49253

Trending Articles



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