.AuthWithPassword()不工作

时间:2016-01-14 14:29:28

标签: javascript

出于某种原因,它给了我错误:

  

TypeError:Auth.authWithPassword不是函数       在Scope。$ scope.signIn

我真的不明白,请帮忙! Here 是我的cloud9文件。

这是我的loginController.js:

app.controller('loginController' , ["$firebaseAuth", "$scope", "Auth", "Ref", 

    function($firebaseAuth, $scope, Auth, Ref){

    $scope.signIn = function(){

        Auth.authWithPassword({
            "email": $scope.logInEmail,
            "password": $scope.logInPassword
        } , function(error, userData){

            if(error){

                switch(error.code){

                    default:
                        alert("Error Because of " + error)
                        break;
                }

            }

            else{

                AuthService.User.email = $scope.logInEmail;
                AuthService.User.password = $scope.logInPassword;
                AuthService.User.uid = userData.ui;
                alert("Succesfully Logged In!")

            }

        })

    }


    }]
)

1 个答案:

答案 0 :(得分:1)

该消息仅表示当您执行Auth.authWithPassword时,authWithPassword不是函数,无法调用。也许它是undefined或者它可能是其他东西(如对象或字符串)。