I am trying to navigate to next page if status code is 200 or response is true. But getting undefined in response.status. If I just log only response I get
{success: true, message: "login successful"}
This below code is getting undefined in console log. I am beginner to Angular and not using any service.
goToHome() {
console.log(this.login);
this.Http.post('http://localhost:3000/users/login', this.login).subscribe((response: Response) => {
console.log(response.status);
// if (resp.status === 200) {
// this.navCtrl.push(TabsPage);
// } else {
// const toast = this.toastController.create({
// message: 'User not found please try again',
// duration: 2000
// });
// toast.present();
// }
})
}