如何显示Firebase数据库中的记录信息?

时间:2016-05-03 14:28:46

标签: angularjs firebase firebase-realtime-database

我的数据库中有这个节点:

enter image description here

我有这个选择列表

enter image description here

我会搜索其startdate与选择列表中的select项匹配的事件。

我尝试使用此代码来显示与今天匹配的evet。 startdate:

//Switch label of selected item : 
 switch($scope.search.dateOption.label)
 {
  case 'Today':
   {
    var reff = new Firebase("https://event-application.firebaseio.com/event");
    reff.orderByChild("startdate").startAt((new Date()).toISOString())
    .on("child_added", function(snapshot) {
     console.log(snapshot.key())
    var a= snapshot.key() ; 
   reff.orderByChild("id").equalTo(a).on("child_added", function(snapshot)  { 
  console.log(snapshot);
  });
 })
   }
    break;
 }

'的console.log(snapshot.key())'效果很好:

enter image description here

但是当我尝试显示所有记录信息时,不会显示任何内容。 有人可以帮帮我吗。

0 个答案:

没有答案
相关问题