app.factory("Auth", ["$firebaseAuth", function($firebaseAuth) {
var ref = new Firebase("https://XXXXXX.firebaseio.com/");
var auth = $firebaseAuth(ref);
var Auth = {
login: function(){
return auth.$authWithPassword({
"email": "[email protected]", //hard-coding in the email & password for testing
"password": "1"
}, function(error, authData) {
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Login Success!", authData);
}
});
}
return Auth;
}]);
app.controller("SampleCtrl", ["$scope", "Auth", "$firebaseAuth", function($scope, Auth, $firebaseAuth) {
$scope.login = Auth.login();
}]);
나는 angularFire 사용자 인증 기능이 오류를 반환AngularFire authWithPassword는
<button ng-click="login()">Login</button>
를 사용하는 공장을 만들려고하고 각 공장 작동하지? PLUNKER
Plunkr에서 이것을 재현 할 수 있습니까? –
도와주세요 http://plnkr.co/edit/8fNus4oiqEFmMXNjq6D1?p=preview – user2901633