Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    What I understood is that I use {{filteredData.length}} instead of data.length. I also understood that myInputModel is the model mapped to the input query which filters the data. val would be the text that is typed in the input (basically query) but each time I type, it changes. But what is filterFilter here? I might add that I have my own customFilter created (wherein I can specify which key of the object to consider for filtering). Commented Mar 9, 2013 at 22:09
  • That's right. Also just use ng-repeat="person in filteredData" as there is no sense filtering it twice. With the $filter service, you can ask for a specific filter by just suffixing it with "Filter", e.g.: dateFilter, jsonFilter, etc. If you are using your own custom filter, just use that one instead of the generic filterFilter. Commented Mar 9, 2013 at 22:16
  • What about applying multiple filters to one ng-repeat, say you have 2 dropdowns with values and one text input field? Commented Mar 13, 2013 at 8:44
  • The filter is just a function, so you'd just pass the output of the first filter to the second filter. Commented Mar 13, 2013 at 17:39