angularjs - Firebase setting user data on registration -


I want to create a new user in my firebase. This code is using I:

  function createUser (email, password, username) {ref.createUser ({email: email, password: password}, ​​function (error) {If (error === faucet) {$ Activity indicator.stopenimating (); $ scope.padding_error = null; $ scope.error = null; logUserIn (email, password);} and {$ activity indicator.stopenimating (); Console.log (error .code); switch (error code) {case "INVALID_EMAIL": $ scope.padding_error = "10"; $ scope.error = "fail e-mail address order falls passport"; $ radius. $ Applicable (); Case "INVALID_PASSWORD": $ scope.paddi $ Scope.error = "False email address order fails passport"; $ scope $ apply; E-mail address ST registrar "; $ scope $ apply ().}}}}); }  

I also want to store the username in my firebug besides the email and password. How is this possible immediately after user registration?

If registration is successful, then you can simply push email and firebase password variables For {Code> function create user (email, password, usernames) {ref.createUser ({email: email, password: password}, ​​function (error) {if (error === null) {... registration successful $ Activity indicator. Stop animating (); $ scope.padding_error = null; $ scope.error = null; ## Renewal # # emailRef = New Firebase ("& lt; YOURFIREBASEURL & gt; / accounts /" + Username + " / Email ") passRef = new firb ("& Lt; YOURFIREBASEURL & gt; / accounts /" + username + "/ password") EmailRF.set (email) passRef.set (password) log user (email, password);} and { Something went wrong}}}); }


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -