In my angularjs application, I get the following sample data through json:
{"id":"1a", "name": "aaa", "emails": {{"123@123.com"}, {"123@123.info"}}},
{"id":"2a", "name": "aba", "emails": {{"23@123.com"}, {"3@123.info"}}},
{"id":"3a", "name": "aab", "emails": {{"3@123.com"}, {"3@123.info"}}},
and for performance reasons, I did not use a filter for ng-repeat, but I use the ng-show scheme ...
therefore, in the controller I have this code (search is my input value):
$scope.$watch('search', function(newVal, oldVal) {
$scope.filteredArray = $filter('filter')($scope.users, $scope.search, newVal);
});
but it searches even in id, for example, I enter a and get it from id, but I do not need the field identifier here ...
So, how to search for a filter only in certain fields?