TypeError:无法读取未定义的firebase的属性“Scroll”

时间:2016-04-20 17:51:11

标签: angularjs firebase angularfire firebase-realtime-database nginfinitescroll

使用firebase.util创建infiniteScroll。我使用bower下载了firebase util。然后我尝试了这段代码:

在我的HTML文件中:

<div class="list">
<div ng-repeat="e in events "  class="item" >
<div class="list" >
 <a class="item item-thumbnail-left" ui-sref='eventDetail({eventId:e.$id})'>
  <img src="img/ionic.png">
   <h2>{{e.name}}</h2>
   <h2>Categerie: {{e.categorie.label}}</h2>
 </a>
</div>
</div>

<ion-infinite-scroll ng-if="!noMoreItemsAvailable" on-infinite="loadMore()" distance="10%"></ion-infinite-scroll>

在我的控制器中:

var baseRef = new Firebase('https://event-application.firebaseio.com/event');  
var scrollRef = new Firebase.util.Scroll(baseRef, 'name');
$scope.events = $firebaseArray(scrollRef);
scrollRef.scroll.next(3);
$scope.loadMore = function() {
  scrollRef.scroll.next(2);
  $scope.$broadcast('scroll.infiniteScrollComplete');
};

感谢任何帮助。

0 个答案:

没有答案