I am trying to filter nested objects in ng-repeat by using a search textbox.
Given the following object:
$scope.items = {
\"1\": {
name:
If you don't need to reuse your filter anywhere else, you can write your filtering function in controller.
scope.customSearchFilter = function(term){
return function(item) {
var regex = new RegExp(term || '', 'i');
return regex.test(item.name + '');
};
};
Filter argument is a single item, not an array.
Here is examples. 1st variant is with model, and 2nd with plain scope:
https://plnkr.co/edit/ELH8S5GymG8cHfOJqD9G