gpt4 book ai didi

javascript - 过滤搜索 AngularJS

转载 作者:行者123 更新时间:2023-11-30 11:19:00 25 4
gpt4 key购买 nike

我想过滤搜索我的目录 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

提前感谢您的回答!!!

最佳答案

试试这个替代方法:

  <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>

演示:https://plnkr.co/edit/hxfgKziEAXHJeGjcmg9z?p=preview

关于javascript - 过滤搜索 AngularJS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50521978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com