【问题标题】:why list is not display while using collection-repeat instead of ng-repeat为什么在使用 collection-repeat 而不是 ng-repeat 时不显示列表
【发布时间】:2016-10-03 03:10:50
【问题描述】:

我在演示中使用了 ng -repeat。但是由于来自服务的大量数据。我想使用 collection-repeat 来提高性能。我将如何使用 collection-repeat 来获得相同的结果。这是我的笨蛋

<ion-scroll scrollbar-y="true" delegate-handle="i" ng-style="viewHeight">
          <div class="row" ng-repeat="column in i | limitTo: counter  track by $index" ng-class-odd="'odd-row'">
            <div class="col brd collapse-sm" ng-repeat="field in column.columns" ng-show="i[$index].checked && i[$index].f===field.fieldNameOrPath">{{field.value}}</div>
            <div class="col col-10 text-center brd collapse-sm"></div>
          </div>
        </ion-scroll>
        <ion-infinite-scroll immediate-check="false" on-infinite="loadMore(query)" distance="10%"></ion-infinite-scroll>

我在这里尝试使用这样的集合重复

但没有得到相同的结果

我们可以使用细网格视图吗?

【问题讨论】:

  • 有什么更新吗?关于这个
  • 你见过吗,看起来这可能是一个错误,收集重复设置高度的东西。 forum.ionicframework.com/t/…
  • 能否请您提供一些解决方案..我将如何实现这一目标
  • 所以你有
    尝试添加 item-height="200" 所以你最终得到
    。几乎您可以使用 item-height 和 item-width 并希望它能够正常工作。看看这里的文档ionicframework.com/docs/api/directive/collectionRepeat
  • Plunker 链接丢失?

标签: angularjs angularjs-directive angularjs-scope ionic-framework ionic


【解决方案1】:

希望您现在能够找到答案,但以防万一,希望这会有所帮助...

集合重复不支持“limitTo: counter track by $index

如果您仍有问题,请告诉我。

【讨论】:

    猜你喜欢
    相关资源
    最近更新 更多
    热门标签