My code so far:
$(document).ready(function(){
var rootRef=firebase.database().ref().child("users");
rootRef.on("child_added",snap=>{
var name=snap.child("Name").val();
var email=snap.child("Email").val();
$("#table_body").append("<tr><td>"+name+"</td><td>"+email+ "</td><td><button class='remove_btn'>Remove</button></td></tr>");
});
});
I used child_added event which retrieves the child data of users, but it does not update the data in real-time when I update the data in Firebase. user_update event does that thing, but I don't know how to use both of these events to solve the problem.
Can anyone tell me how to retrieve multiple data in real-time from Firebase?
Aucun commentaire:
Enregistrer un commentaire