angularjs - How to use an angular filter to search an array of objects with results limited bv more than one property -


i attempting apply standard angular filter array of objects not wanting have search text applied entire object, rather properties. example, if have array of objects looks

$scope.ppl =      [{       "name": "sue",       "age": 37,       "location": "40.5630° n, 122.3255° w"     },     {       "name": "ann",       "age": 40,       "location": "37.7749° n, 122.4194° w"     }] 

and i'd find age 37, if search text "37", both items in array because 37 matches both age on sue , portion of location on ann, though had no interest in latter property.

from docs, see it's possible limit property of interest in array of objects object notation. works fine me use filter expression in html

ng-repeat="person in ppl | filter:{age: searchtext}" 

with input set ng-model="searchtext"

perfectly fine. want search on more 1 property, while still not including of them.

i thought

ng-repeat="person in ppl | filter:{age: searchtext, name: searchtext}" <-- note added property

however upon more closely reading documentation, found limits results object having both properties match model, opposed either.

does know of way of filtering such results include match on property x || property y opposed property x && property y?

thanks!


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -