简体   繁体   中英

How to apply more than one filter in angularJs

i'm applying two filters on a div like

 <div  ng-repeat="item1 in filterItems(d) |  filter:query | findobj : selected ">

But its not working properly

Here is the Working Jsfiddle

The best i can do is this.

It's not the sexiest, but it works.

Working fiddle

HTML :

Added a select

<select ng-model="category2">
    <option value=""></option>
    <option value="Goto">Goto</option>
    <option value="MainHeading">MainHeading</option>
    <option value="PageID">PageID</option>
</select>

Added this kind of clauses to your html div

ng-show="category2=='Goto'||category2===''"

JS : Just intialized the var to ''

$scope.category2 = "";

That's not exactly what you're looking for. That's not the best things to do. But at least it works.

Hope it helped

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM