Faud Faud - 1 year ago 85
AngularJS Question

Why does not work filter with track by $index?

There is unput field on page:

<input type="text" ng-model="searchInside">


ng-repeat="item in details track by $index | filter:searchInside"

When I insert symbols in input filter
does not work

Answer Source

Because filters should be applied before the track by expression. So, move track by $index to the end:

item in details | filter:searchInside track by $index
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download