0

I have ng-repeat with search filter:

 <div class="user-item item" ng-repeat="(key, itm) in filtered = (app | filter:searchInside | orderObjectBy:'id':true | groupBy: 'date_title') track by $index">

When I pass word in input field with ng-model="searchInside" I get filtered items in filtered.

But when I do {{filtered.length}} I get nothing always.

How I can count filtered data?

Muhad
  • 283
  • 1
  • 5
  • 14

1 Answers1

5

Assign the results to a new variable (e.g. filtered) and access it:

<div ng-repeat="person in filtered = (data | filter: query)">
</div>

Display the number of results:

Showing {{filtered.length}} Persons

see the similar example

Ali Adravi
  • 21,707
  • 9
  • 87
  • 85