When using ng-repeat I want to filter object by two values (name and description). I want to filter this array in way if in any key exists value in search it will return it. When I'm trying this filter:{info:{name:search, description:search}} the result is when value from search equals in both.
1 Answer
Okay so based on what I have been able to understand. Although I am not sure if this is what you wanted, if not let me know and I will delete this answer.
Let's say you have object that has values in this format which you are feeding to ng-repeat.
$scope.inputobject = [
{name: 'xyz', description: 'hadhash'},
{name: 'uza', description: 'hadhahdh'},
{name: 'aaa', description: 'hadhahas'}
];
This is our HTML part now, add the controller and all, I hope that wont be a problem.
<input type="text" placeholder="search" ng-model="objectsearch">
<div ng-repeat="x in inputobject | filter:{name:objectsearch}">
<div>
{{x.name}} {{x.lastname}}
</div>
</div>
Now filter will only happen based on first input. Cheers!
ng-repeatvalues?