I have a table built with ng-repeat
this way:
<tr ng-repeat="book in books | filter:searchText | orderBy: 'title'">
<td>{{book.author}}</td>
<td>{{book.title}}</td>
<td>{{book.editor}}</td>
</tr>
And books
is an object which has more properties than the ones shown in the table. The research is simply implemented this way:
<label>Search: <input ng-model="searchText"/></label>
Now, what I need to do is apply the search filter ONLY to those data fields which are shown in the table. For example: let's suppose my data source books
has these fields: title
, author
, editor
, year
, isbn
, description
. As it is now, if I type some words in the search input, the results are filtered considering ALL those fields, so I could visualize also some books containing that word in their description, resulting in some unclear search (the user has searched a word but can not see it in the results).
How can I apply the research only to the shown fields (I don't want to delete the unshown fields because I need them for other functions)?