I'm trying to implement a simple search textfield. I want it to display contacts by filtering their name and phone number. It seems like whenever I type in a letter , it shows me all of the contacts' names that have that letter in their name, but it also searches the other attributes of each contact (address, city, mail, etc), so if a contact's name does not contain the letter, it's still shown becuase its other attributes contain it. Obviously that is not what I am trying to implement.
I want it to be able to filter contacts by both name and phone number.
<input type="text" ng-model="query" placeholder="search"/>
<div ng-repeat="c in contacts|filter: query"> ...<\div>
How can I solve this problem? Thanks for helping