This is my code:
<div ng-repeat="cat in categs | filter:searchText">
<div><h1 id="{{cat.id}}">{{cat.title}}</h1></div>
<table>
<tbody>
<tr ng-repeat-start="subcat in cat.data | filter:searchText">
<th><h2 id="{{cat.id}}_{{subcat.id}}">{{subcat.title}}</h2></th>
</tr>
<tr ng-repeat-start="subsubcat in subcat.data | filter:searchText">
<td><h3 id="{{cat.id}}_{{subcat.id}}_{{subsubcat.id}}">{{subsubcat.title}}</h3></td>
</tr>
<tr>
<th>Nombre</th>
<th>Descripcion</th>
<th>Enlace</th>
</tr>
<tr ng-repeat-end ng-repeat="item in subsubcat.data | filter:searchText">
<td>{{item.name}}</td>
<td>{{item.about}}</td>
<td><a href="{{item.url}}" target="_blank">{{item.urltext}}</a></td>
</tr>
<tr ng-repeat-end>
<td></td>
</tr>
</tbody>
</table>
</div>
and the current filtering isn't working for what I want to do, that is:
If the title of h1,h2 or h3 matches searchText, then show everything nested inside (don't filter anything inside).
But if neither h1,h2 or h3 matches searchText but what's in the last ng-repeat-start matches something, filter only what matched.
To explain myself better, here is an example:
If searchText is:
The problem of the current code is that, if I remove the filter from the last ng-repeat-start it does what I want to do in the cars example but doesn't work for the black example.