0

Is there a way to filter by property, something like this:

<tr ng-repeat="person in people| filter: {age>20}" >

that without a custom filter function?

serge
  • 13,940
  • 35
  • 121
  • 205

4 Answers4

0

you can define a filter function inside controller Related

or see Here

Community
  • 1
  • 1
abdoutelb
  • 1,015
  • 1
  • 15
  • 33
0

You can use ng-if directive for this

 ng-repeat="person in people" ng-if="person.age > 20" 
Hadi J
  • 16,989
  • 4
  • 36
  • 62
0

If for some reason you don't want to use custom filter, you can apply ng-show, somthing like:

<td ng-show ="person.age > 20">{{person}}</td>

Regarding your question - you can't.

Itsik Mauyhas
  • 3,824
  • 14
  • 69
  • 114
0
<tr ng-repeat="person in people | filter:{person.age > 20}">

Angular Expression Doc.

Regards

Hardik Vaghani
  • 2,163
  • 24
  • 46