1
firebaseを使用してユーザーを認証しようとしています。 Firebase 2.xxを使用して私のアプリを起動しましたが、Firebase 3.xxにアップグレードした後でも、 というエラーが発生しました。 "onAuthStateChangedは関数ではありません"というエラーです。On Auth Stateが変更されました。AngularFire
これは私のログイン機能が
.controller('HomeCtrl', ['$scope','$location','CommonProp','$firebaseAuth', '$firebaseObject',function($scope,$location,CommonProp,$firebaseAuth,$firebaseObject) {
var firebaseObj = $firebaseObject(rootRef);
var loginObj = $firebaseAuth(firebaseObj);
$scope.SignIn = function($scope, user) {
event.preventDefault(); // To prevent form refresh
var username = user.email;
var password = user.password;
loginObj.$signInWithEmailAndPassword({
email: username,
password: password
})
.then(function(user) {
// Success callback
console.log('Authentication successful');
$location.path("/welcome");
CommonProp.setUser(user.password.email);
}, function(error) {
// Failure callback
console.log(error);
});
}
}]);