从离子中的Firebase获取数据

时间:2019-11-30 07:28:20

标签: firebase-realtime-database ionic4

I have a ionic 4 app that I want to retrieve the data from firebase real time database, as per the image from below I want to retrieve "This is the title" i am trying to achieve this by data snapshots but I am getting only the value "titlu1" in my app, can you please help my in this issue.

这是代码

  ref = firebase.database().ref('Titlu/titlu1');    

this.ref.once("value")
      .then(function(snapshot) {
        var key = snapshot.key; // "ada"
        var childKey = snapshot.child("titlu1/Acesta este titlu").key; // "last"
        console.log(childKey);
      });

0 个答案:

没有答案