Take a look at the example here: http://docs.angularjs.org/api/ng.filter:filter
You can search by any of the phone properties by using <input ng-model="search">
and you can search by just the name by using <input ng-model="search.name">
, and the results are appropriately filtered by name (typing in a phone number does not return any results, as expected).
Let's say I have a model with a "name" property, a "phone" property, and a "secret" property, how would I go about filtering by both the "name" and "phone" properties and not the "secret" property? So in essence, the user could type a name or phone number and the ng-repeat
would filter correctly, but even if the user typed in a value that equaled part of a "secret" value, it wouldn't return anything.
Thanks.