我想过滤搜索我的目录json
,但我的代码不起作用,这里是代码:
<input type="text" style="width:275px;margin-top:5px;" class="form-control form-control-sm form-control-rounded" placeholder="Search..." ng-model="search">
<br />
<br />
<div class="panel-body">
<div class="cui-ecommerce--catalog">
<div class="row">
<div ng-repeat="(name, text) in textures | filter:search">
<div ng-repeat="url in text">
<div>
{{url.url}}
<a href="javascript: void(0);" style="cursor:default;">
<img ng-src="{{url.url }}" />
</a>
</div>
</div>
</div>
</div>
</div>
</div>
我的傻瓜:https://plnkr.co/edit/30nyExfhnLWy35p906CJ?p=preview
提前感谢您的回答!!!
答案 0 :(得分:3)
尝试这种替代方法:
<div class="panel-body">
<div class="cui-ecommerce--catalog">
<div class="row">
<div ng-repeat="(name, text) in textures">
<div ng-if="url.url.indexOf(search||'')>-1" ng-repeat="url in text" >
<div>
{{url.url}}
<a href="javascript: void(0);" style="cursor:default;">
<img ng-src="{{url.url }}" />
</a>
</div>
</div>
</div>
</div>
</div>
</div>