I need to add a free text filter with only one text input to a table. Unfortunately standard filter operates on all values. For examples with this JSON array:
myJsonArray = [{col1: "xxx", col2: "yyy", col3: "zzz"},{...}]
I want to filter only on col1 and col2. Here's my code:
<input type="text" placeholder="Search for the first 2 columns..." ng-model="searchCols">
[...]
<tr ng-repeat="a in myJsonArray | filter : searchCols">
[...]
How can I say to filter: filter only col1 and col2 with text in searchCols? I've already tried something like this but didn't work:
<tr ng-repeat="a in myJsonArray | filter : {'col1' :searchCols, 'col2': searchCols">