【发布时间】:2017-06-16 19:16:45
【问题描述】:
我有这个登录功能,它正在工作。但我只在没有发现错误的情况下才尝试重定向。我在下面尝试了这段代码,但这并没有按照我想要的方式工作,任何想法,比如我不知道的成功函数?
$scope.loginEmail = function($email, $password){
var testing = 1;
$scope.error = '';
firebase.auth().signInWithEmailAndPassword($email, $password).catch(function(error) {
var errorCode = error.code;
var errorMessage = error.message;
$scope.error = errorMessage;
testing = 0;
console.log("Testing 1 : ", testing);
});
if(testing === 1)
{
console.log("Testing 2 : ", testing);
$state.go("menu.VNements");
}
};
【问题讨论】:
标签: javascript angularjs firebase ionic-framework firebase-authentication