login() { this.fireauth.auth.signInWithEmailAndPassword(this.email, this.password) .then(res => { if (res.user) { console.log(res.user); this.router.navigate(['/home']); } }) .catch(err => { console.log(`login failed ${err}`); this.error = err.message; }); }