I have a function that logs in a user successfully.
_login: function() {
var email = this.$.emailvalue.value;
var password = this.$.passwordvalue.value;
return this.$.authenticate.signInWithEmailAndPassword(email, password).then(function() {
// Sign-in successful.
//this._animateView(); **returns undefined**
}, function(error) {
// An error happened.
// // Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(errorMessage);
// this._animateErrorView(); **returns undefined**
});
},
What I want is to call a function this._animateView();
when a user logs in successfully and this._animateErrorView()
when there is an error.
If I try to do that It returns undefined.. How do I solve this issue