javascriptangularjsng-filter

AngularJS: Apply search filter only to first child of ng-repeat


I have the MVP plunkr Here

I m trying to apply the search function only to the activePlayers list and not on all 3 lists.

i tried something like

<li ng-repeat="item in list | filter: {activePlayers: searchText}"

But that did not worked out too well.

Any help is highly appreciated.


Solution

  • Use filter: listName== 'activePlayers'? searchText : ''

    It will work.