How to get the value of <ion input> in the ion skeleton?

I want the value of the following input elements, so what should I do?

  <ion-item> <ion-label floating>Username</ion-label> <ion-input type="text" ></ion-input> </ion-item> <ion-item> <ion-label floating>Password</ion-label> <ion-input type="password" ></ion-input> </ion-item> </ion-list> 
+7
source share
1 answer

Ok, I know a little about ionic 2 .... so I suggest you use the ng model for inputs, as shown below

 <ion-item> <ion-label floating>Username</ion-label> <ion-input type="text" [(ngModel)]="username"></ion-input> </ion-item> <ion-item> <ion-label floating>Password</ion-label> <ion-input type="password" [(ngModel)]="password"></ion-input> </ion-item> </ion-list> 

for its ionic ng model

for ion two of it [(ngModel)]

Hope this helps you a little

Update

 https://ionicframework.com/docs/v2/resources/forms/ 

see the above link .. in this they used this.todo inside the logform function .... I understand this, but I don't know what the bla bla export class is .....

 export class FormsPage { todo = {} logForm() { console.log(this.todo) } } 
+8
source

All Articles