I have a complex object (a user object) that has nested arrays and nested objects within it.
I have a search filter that is relatively complicated as well (checkboxes determining which items are returned, along with a search input).
Currently I search in an object like so:
for(var key in item){
if(item[key] && item[key].length && String(item[key]).toLowerCase().indexOf($rootScope.filt.searchFilter.toLowerCase()) !== -1){
realSave = true;
}
}
However, this only works for the first layer of objects within an item; I need to also search for objects within objects.
How can i do this? Is this a simpler way than the above? (Note, I can't just use ng-repeat="item in items | searchFilter" as this needs to also parse checkboxes and return values accordingly.