I'm building an application using Angular.js. In this app I'm getting some data via AJAX in JSON format. I'm showing this data listed in a table, and I put a search text input to filter it.
I implemented the filter this way:
[...]
<input ng-model="searchText"/>
[...]
<tr ng-repeat="data in datarray | filter:searchText">
<td>{{data.title}}<td>
<td>{{data.message}}<td>
<tr>
[...]
What I want (and don't know how) to do is filtering this data only for certain fields (e.g. its title).
For example: if I have data[0]
with title "cats" and message "cats and dogs", and data[1]
titled "dogs" and with message "cats and dogs", and I search for "cats", I want only data[0]
to be shown, without considering data messages but only the titles.