我在firebase中的网址“ https://wpladv.firebaseio.com/adventure”中有一些数据,并且我的js文件中包含以下代码:

.factory('dataUpdate', ['angularFireCollection', function(angularFireCollection) {
  var dbUrl = 'https://wpladv.firebaseio.com/adventure';
  return {
    adventures: function(){
      var cat = '/adventure';
      return angularFireCollection(dbUrl + cat);
    }
  }
}])


我的HTML中也有以下代码

<ul class="unstyled">
  <li ng-repeat="adventure in adventures">
    <div class="well">
      <h4>{{adventure.name}}</h4>
      <h5><em>{{adventure.desc}}</em></h5>
      <p>{{adventure.theme}}</p>
      <p>{{adventure.like}}%</p>
      <p>Taken by {{adventure.used}}</p>
   </div>
  </li>
</ul>


firebase中的数据使用JSON。我的问题是如何使用angularfire集合对象在URL中显示数据?我是angularfire的新手,任何建议将不胜感激。
提前致谢。

最佳答案

首先,请执行really simple tutorial。它可以帮助您了解角度和火力基础。

您必须将Firebase数据绑定到目标作用域。
这通常是在控制器中完成的(请参阅本教程的this specific step

09-12 00:36