in my login function (authService) i set email, and i get it in other component using authService, but when i refresh the page i lose data (email) and get undefined as a value.
class AuthService :
email: string;
signinUser(email: string, password: string) {
firebase.auth()
.signInWithEmailAndPassword(email, password)
.then(response => {
this.setEmail(email);
}
//getter for email
getEmail(): string {
return this.email;
}
//setter for email
setEmail(email: string): void {
this.email = email;
}
** class NavbarComponent :**
this.authService.getEmail()
return undefined when the page is refreshed.
Any help will be appreciate, thanks.