So I have a table that is programmatically created and I want to apply a custom filter to only one of the fields. I've created a plunkr here:
http://plnkr.co/edit/57rEPEYNylisoHyBysp4
So by applying the filter to the Age column, the table would return:
Name Age
Enos I'm a number greater than 30: 34
Moroni I'm a number greater than 30: 50
Jacob I'm a number less than 30: 27
Nephi I'm a number less than 30: 29
Enos I'm a number greater than 30: 34
Tiancum I'm a number greater than 30: 43
Jacob I'm a number less than 30: 27
Nephi I'm a number less than 30: 29
Tiancum I'm a number greater than 30: 43
Tiancum I'm a number greater than 30: 43
I've tried:
<td ng-repeat="column in columns | filter:{ age: numCheck }" ng-show="column.visible" sortable="column.field">
{{user[column.field]}}
</td>
Among other things in the HTML. I've also tried changing the getData function in the controller to no avail.
Is it possible to do this?
Best Regards, Julie
EDIT So I created this plunkr which is closer to what I want to do in real life (based on Explosion's answer below):