如果嵌入的ng-repeat块在过滤后没有返回任何值,我怎么能隐藏它? " [如果过滤集中没有项目隐藏]"
<div ng-repeat="thisCategory in Categories">
<div class="panel panel-default" ng-hide="filterResult[$index].length == 0">
<div class="panel-body" [if no items in filtered set hide]>
<div>
</h1>{{thisCategory.Title}}</h1>
</div>
<table class="table table-condensed table-hover">
<tr ng-repeat="app in (filterResult = (apps | filter:search ))">
<td>
{{app.Title}}
</td>
</tr>
</table>
</div>
</div>
</div>
答案 0 :(得分:0)
喜欢的东西;
<table class="table table-condensed table-hover"
ng-show="(filterResult[$index] = (apps | filter:search )).length">
<tr ng-repeat="app in (filterResult[$index] = (apps | filter:search ))">
<td>
{{app.Title}}
</td>
</tr>
</table>