When it comes to filtering data, I usually use the following method:
<input type="search" ng-model="searchTable">
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in $ctrl.rows | filter: searchTable">
<td>{{ row.firstName }}</td>
<td>{{ row.lastName }}</td>
</tr>
</tbody>
</table>
If the
<input type="search" ng-model="searchTable">
and <tr ng-repeat="row in $ctrl.rows | filter: searchTable">
are located in separate components, filtering might require a different approach.
You can view a demonstration on this fiddle.
To separate the components, you may need to include an $onChanges()
and utilize expression binding like bindings: { onChange: '&' }
within the searchComponent
. However, implementing this solution completely might be a bit challenging at first.
I hope this helps clarify things for you. Let me know if you have any further questions.