Let's say I have model:
$scope.items = [{'name: 'test',value:'some value',category:'test'},{name:'value',value:'test',category:'test'}];
Which is iterated:
<div ng-repeat="item in items|filter:search">
{{item.name}} – {{item.value}}
</div>
And have an input box with filter model:
<input type="text" ng-model="search.$" />
When I type 'test' it shows both records. However, I need to dynamically select the properties of the initial object which will be used for the search.
So, I have three checkboxes (in real project I have more options to combine):
<input type="checkbox" ng-model="search.name" />
<input type="checkbox" ng-model="search.value" />
<input type="checkbox" ng-model="search.category" />
And in my controller:
$scope.search = {name: true, value: true,category: true};
This does not show any items at all. But I need to filter items by different fields changing the search properties on the fly (and combining them in different variants)
How is that possible?