简体   繁体   中英

AngularJS filter on multiple deep nested properties

I've couple of select fields on basis of which I want to filter data. Here is working plukr: http://plnkr.co/edit/VUnAoL2Sl0IqGcZqHbbi?p=preview

If I select any one value from select, it works fine, but when I select the other one it don't show any data.

These filters are going to be dynamic (depending on number of columns) So I want that in HTML I could use it with single filter declaration like: <tr ng-repeat="row in data | filter:{columns: filt}">

Not like: <tr ng-repeat="row in data | filter:{columns: filt.something} | filter: {some: thing}">

    <tr ng-repeat="row in _data = (data | filter:{columns: {dealType:filt.dealType}}) | filter:{columns:{primaryUse:filt.primaryUse}}">
       <td ng-repeat="column in row.columns">
           {{column[column.header]}}
       </td>
   </tr>

I have got the same issue and it worked with a change in your code as above. Thanks

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