Angular, limitTo and track by $index

后端 未结 2 426
渐次进展
渐次进展 2021-01-01 10:22

I am trying to limit an object coming in by filtering (because there will be an option to show all eventually), however I am running into issues when trying to limitTo and t

相关标签:
2条回答
  • 2021-01-01 10:45

    Filters, like limitTo, orderBy, etc... must come before track by, since they apply to the array source, rather than to the track by expression.

    <div ng-repeat="item in filter.values | limitTo:filterLimit track by $index">
    
    0 讨论(0)
  • 2021-01-01 11:06

    Try this Use limitTo before track by

     <div ng-repeat="item in filter.values | limitTo:filterLimit track by $index" class="cengage-builder-result-filter-value" value="item" update-filter="updateFilter">
    
    0 讨论(0)
提交回复
热议问题