I wanted to filter a list with a model value from the text box.
Example
var person={};
person.Id=1;
person.Name="Test 1";
person.PetName="Rest 1"
var persons=[];
persons.push(person);
person.Id=2;
person.Name="Test ds";
person.PetName="Rest sd";
persons.push(person);
Persons array will have multiple persons. In HTML I have one search box.
<input type="text" ng-model="seachText" placeholder="search by Name and pet name"/>
<div ng-repeat="person in persons | filter : {$:seachText}">
<div>{{person.Name}}</div>
</div>
Case 1:
When I enter 2 in the text box, one result will appear. I don't want that. I want to filter by name and pet-name only.
Is there any possibility to achieve this without a custom filter? Does filter directive allow OR condition for properties?
Please help. Thanks.