I have been trying to add data to my database without any luck. In my code i have made a button when click, it will add data to my users database but it will not add it to the user but it just add the data outside like this:why is the data not inside my user
is it because you cant add data when you have use the createUserWithEmailAndPassword() function?
Can anyone please show me how it is done?
btn.addEventListener("click", function()
{
firebase.auth().onAuthStateChanged(function(user)
{
if (user)
{
var massage = inputText.value;
var ref = database.ref("Users");
var data = {
display: massage
}
ref.push(data);
}
});
});
Aucun commentaire:
Enregistrer un commentaire