I have some problem with filtering nested object. In select I choose the filter parameter(object value) and in input I type some text that searches it in object key.
Tried to write custom filter with recursion for deep search but it doesn't work.
input is parameter for object in ng-repeat, param1 is for select's ng-model and param2 is for input's ng-model.
JS
.filter('personFilter', function($filter) {
return function(input, param1, param2) {
var output = {};
for (var prop in input) {
if (typeof input[prop] == 'object' || prop != param1 && input[prop] != param2) {
$filter('personFilter')(input[prop]);
} else {
output[key] = input[key];
}
}
return output;
}
Here's the plunker: http://plnkr.co/edit/83lPNRWFy6wa9U2FkMfH?p=preview
I hope someone give me some advice
Uncaught SyntaxError: Unexpected token :because format can be somehting like[{'node1': {node2: ''}}]not['node1': {...}]