lundi 28 janvier 2019

Firebase - How to get the child of child of child and display into the HTML table?

Firebase Database Image. Please click here to have a look I would like to get the data of name, phone number, foodName and quantity and show it in my HTML table. But I have no idea how to get it since I'm a beginner.

var rootRef = firebase.database().ref().child("Requests");

rootRef.on("child_added", snap => {

var name = snap.child("name").val();

var phone = snap.child("phonenumber").val();

var foodname = snap.child("foodName").val();

var quantity = snap.child("quantity").val();

}

I expect I will able to get the data of name, phonenumber, foodName and quantity and display to my HTML table.




Aucun commentaire:

Enregistrer un commentaire