Firebase注册了用户 – 将用户存储在注册用户中

如何将用户存储在节点中,而不仅仅是注册用户,这是当前代码正在做的事(在firebase中)下面是代码login控制器我有感谢:

app.controller('LoginCtrl', function($scope, $state) { 

$ scope.data = {};

$ scope.signupEmail = function(){

 var ref = new Firebase("https://FIREBASE-APP>.firebaseio.com"); ref.createUser({ email : $scope.data.email, password : $scope.data.password }, function(error, userData) { if (error) { console.log("Error creating user:", error); } else { console.log("Successfully created user account with uid:", userData.uid); } }); 

};

       

网上收集的解决方案 "Firebase注册了用户 – 将用户存储在注册用户中"

相关的用户数据存储在userData对象中。 为了保存它,你可以做这样的事情:

 ref.createUser({ email : $scope.data.email, password : $scope.data.password }, function(error, userData) { if (error) { console.log("Error creating user:", error); } else { console.log("Successfully created user account with uid:", userData.uid); ref.child('users').push(userData); // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } });