0

我有一个使用此代码创建的工作温泉懒惰重复列表:

HTML:

<ons-page ng-controller="LazyListController as list" ng-init="init(homeNavigator.topPage.data.wordlistId)">
  <ons-toolbar>
    <div class="left">
      <ons-back-button>Back</ons-back-button>
    </div>
    <div class="center">{{ homeNavigator.topPage.data.title }}</div>
  </ons-toolbar>

<ons-list>
  <ons-list-item class="list-item-container" ons-lazy-repeat="MyDelegate" id="lazy_list">
  </ons-list-item>
</ons-list>
</ons-page>

JS:

var app = angular.module('myApp', ['onsen', 'ngCordova']);
  app.controller('LazyListController', function ($scope, $window, $document, $cordovaCamera) {

$scope.MyDelegate = {
  configureItemScope: function (index, itemScope) {

   ... 


  },
  countItems: function () {
    return $scope.wordsInList != undefined ? $scope.wordsInList.length : 0;
  },
  calculateItemHeight: function () {
    return ons.platform.isAndroid() ? 100 : 100;
  }
};

updateEditList = function (wordlistId) {

  ...
    $scope.MyDelegate.refresh();
  ...

});

但是,当我稍后打电话时,$scope.MyDelegate.refresh();我收到刷新不是函数的错误。我不确定如何调用刷新方法!

4

0 回答 0