This is my html
<body>
<div ng-app="repeatdemo" ng-controller="rd">
<input type="text" ng-model="nameSearch" />
<div ng-repeat="x in names track by $index | filter : nameSearch">
{{x }}
</div>
</div>
This is my script
<script>
var rdapp=angular.module("repeatdemo",[]);
rdapp.controller("rd",function($scope){
$scope.names=['deepu','vicky','hello','hey','vickys'];
});
</script>
When i am using track by $index in repeat
option , the filter is not working
Please check this fiddle and try removing track by index
in ng-repeat
Problem is the order you're applying the filter and the track by in
http://jsfiddle.net/n3xnzvvs/1/
<div ng-repeat="x in names | filter : nameSearch track by $index">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With