lundi 26 novembre 2018

retrieve child value in firebase [web]

how can I retrieve the child "hi" into a textbox, I have the code that retrieve the others, but I don't know how to retrieve child of child, please help

this is my database structure

and this is the code:

mahasiswaRef = firebase.database().ref();
mahasiswaRef2.on("value", function(snapshot)
{
    var data = snapshot.val();
    var files ="";
    for(var key in data)
    {
        files += "<tr>"+
                           "<td>" + data[key].nim+ "</td>"+ 
                           "<td>" + data[key].nama + "</td>"+
                           "<td>" + data[key].alamat + "</td>"+
                           "<td>" + data[key].usia + "</td>"+
                           '<td>'+'<button class="btn btn-primary edit" data-validasi="'+key+'">Edit</button>'+'</td>' +
                           '<td>'+'<button class="btn btn-danger hapus" data-validasi="'+key+'">Hapus</button>'+'</td>' +
                          "<tr>";


    }

});




Aucun commentaire:

Enregistrer un commentaire