+ 1
How to use firebase request like Promises ? (Javascript)
All is in the question.
2 ответов
+ 1
firebase.auth().signInWithEmailAndPassword(email, password).then(function(user) {
// user signed in
}).catch(function(error) {
var errorCode = error.code;
var errorMessage = error.message;
if (errorCode === 'auth/wrong-password') {
alert('Wrong password.');
} else {
alert(errorMessage);
}
console.log(error);
});
Basically this is promise which is handled in catch easily.
+ 1
Kunal Thakur thanks