Faud Faud - 1 month ago 6
AngularJS Question

Why does not work filter with track by $index?

There is unput field on page:

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


Also
ng-repeat
below:

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


When I insert symbols in input filter
searchInside
does not work

Answer

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