Hello, I’m new in Ionic, and need to put a value of an input with empty with typescript. Can i do this? How?
<ion-content padding>
<ion-list>
<ion-item>
<ion-label floating>Username</ion-label>
<ion-input type="text" name="username" [(ngModel)]="data.username"></ion-input>
</ion-item>
<button ion-button block (click)="submit()">Submit to server</button>
</ion-list>
submit() {
var link = 'http://jundar.ironhide.com.ar/web.php';
var myData = JSON.stringify({username: this.data.username});
this.http.post(link, myData)
.subscribe(data => {
this.data.response = data["_body"];
//https://stackoverflow.com/questions/39574305/property-body-does-not-exist-on-type-response
}, error => {
console.log("Oooops!");
});
}
…