Angular get length of filtered ng-repeat

后端 未结 1 560
萌比男神i
萌比男神i 2021-02-19 08:26

I have upgraded to Angular 1.2.9 from v 1.0.8 to help with the performance of my app.

I have introduced track by which has improved the speed.

What I used to hav

相关标签:
1条回答
  • 2021-02-19 09:04

    You can create an intermediate variable that will hold the filtered array:

    data-ng-repeat="result in filteredResults = (results | filter:filterPrice | filter:filterCarCategories | etc.)"
    

    and then can use:

    filteredResults.length
    
    0 讨论(0)
提交回复
热议问题