hi guys
i try to build a page to approve a login my code here :
constructor(public nav: NavController, private http: Http ) {
this.nav = nav;
this.http = http;
this.user = {};
this.user.username = ‘’;
this.user.password = ‘’;
this.user.response = ‘’;
}
verifylogin(username, password){
let link = 'xxx/Login.php';
let user = JSON.stringify({username: this.user.username, password: this.user.password});
this.http.post(link, user)
.subscribe(user => {
this.user.response = user._body;
this.flag = true;
},
error => {
console.log("error");
});
if (this.flag == true)
localStorage.setItem('user',JSON.stringify(user));
}
`
but i got an erro in this statement :
this.user.response = user._body;
i use ionic 2 type script and i need to send from app user name and password to server side to authenticate and return the response so any adive if i am doing something wrong and even why this error is occur ?
Thank you in advance