Я только что начал angularfire Auth! И я получаю эту проблему, когда я вхожу в систему, И если у вас есть какие-либо советы о том, как сделать регистрационную форму электронной почты, я был бы более чем рад это услышать. Здесь ошибка я получаю:Пользователь Auth With AngularJs
Error: Firebase.authWithPassword failed: First argument must be a valid object.
Вот мои script.js:
var app = angular.module('LoginApp', ["firebase"])
app.controller('AuthCtrl', [
'$scope', '$rootScope', '$firebaseAuth', function($scope, $rootScope, $firebaseAuth) {
var ref = new Firebase('https://uniquecoders.firebaseio.com/')
$scope.auth = $firebaseAuth(ref);
$scope.signIn = function(){
var ref = new Firebase('https://uniquecoders.firebaseio.com/')
ref.authWithPassword('email', {
email: $scope.signInEmail,
password: $scope.signInPassword
}, function(error,userData){
if(error = 'INVALID_EMAIL'){
alert("The Email you entered is Invalid")
}
else if(error = 'INVALID_PASSWORD'){
alert("The Password you entered is Invalid")
}
else{
console.log(error)
}
})
}
}]
);
и наш Index.html:
<!DOCTYPE html>
<html lang="en-US">
<head>
<script src="jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
<script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/angularfire/1.1.3/angularfire.min.js"></script>
<script src="https://cdn.firebase.com/js/simple-login/1.6.2/firebase-simple-login.js"></script>
<script src = "http://s.codepen.io/assets/libs/modernizr.js"></script>
<script type="text/javascript" src="script.js"></script>
<meta charset="UTF-8">
<meta name="X-UA-Compatible" content="">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="keywords" content="">
<meta name="description" content="">
<title>Login - UniqueCoders</title>
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" href="main.css">
</head>
<body ng-app="LoginApp">
<div id="page">
<header class="container">
<div class="row">
<img src="https://lh5.googleusercontent.com/-UXr_le-DEc4/VogTLE2yDfI/AAAAAAAAAfI/9RycRDVGNu8/w993-h207-no/uniquecoders.png" alt="UniqueCoders">
</div>
</header>
<main class="container">
<div class="row login">
<form ng-controller="AuthCtrl">
<input type="email" name="email" placeholder="Email" ng-model = "signInemail" id="email">
<input type="password" name="password" ng-model = "signInpassword" placeholder="Password" id="password">
<input type="submit" value="Login" ng-click = "signIn()">
</form>
</div>
</main>
<footer class="container">
<div class="row">
<small>© 2016. Unique Coders</small>
</div>
</footer>
</div>
<!-- Scripts at the end for faster loading -->
</body>
</html>
Удалить первый аргумент:... 'Ref.authWithPassword («электронной почты»,' –