@Gatewayapp in my example this.data represent your form data, the best way to do it is to in fact create an object that will encapsulate all your form data which you can then send to your php script.
login.ts
import {Http} from '@angular/http';
...................................
export class HomePage {
loginData = {};
...................................
login() {
this.http.post.('url_to_php', JSON.stringify(this.loginData))
.subscribe(res => {
// res.json() will contain the response from your php script
}
});
}
login.html
<ion-item>
<ion-label fixed>Username</ion-label>
<ion-input type="text" [(ngModel)]="loginData.Username"></ion-input>
</ion-item>
<ion-item>
<ion-label fixed>Password</ion-label>
<ion-input type="password" [(ngModel)]="loginData.Password"></ion-input>
</ion-item>
<button primary id="login" (click)="login()">Login</button>
The login() method will be called from the Login button. Then in this method it gets this.loginData which contains all your form data. Because in each input of your form you set [(ngModel)]=“loginData.Username” etc. I think you should more about the basics of Angular 2 and Ionic 2 also it could help you understand better how it works!