I coudn't find a proper solution for this, I have the code
login.ts
login() {
if(!this.login_form.valid)
return;
this.AuthService.login(this.login_form.value).subscribe((result) => {
if((result.status).toString() == "Success" && result.user){
localStorage.setItem('userData', JSON.stringify(result.user));
this.nav.setRoot(HomePage);
}
}, (err) => {
console.log(err)
});
});
}
AuthService.ts
public login(credentials) {
return this.http.post(this.apiUrl + '/appLogin', JSON.stringify(credentials))
.map((response: Response) => response);
}
i'm getting this error on ionic serve . Why this happening?.
I solved my problem, by the given code
AuthService.ts
Thanks to @phonolog for the reference