I want value of following input elements so what I should 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>
well i know a little bit about ionic 2....so what i suggest you to use ng model for inputs like 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 ionic one its ng-model
for ionic two its [(ngModel)]
Hope this will help you a little bit
update
https://ionicframework.com/docs/v2/resources/forms/
see the above link..in this they used this.todo inside logform function....i am clear about this but i dont know what is that export class bla bla.....
export class FormsPage {
todo = {}
logForm() {
console.log(this.todo)
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With