Imagine having an object like this:
"results" : [
{
"Item.ad_title" : "Test Phone",
"System.id" : "29183546",
"Transaction.price" : "700.00",
"Owner.phone_number" : "22225987",
"Publication" : {
"publication_text" : "bla bla bla "
},
"Item.id" : "142",
"Owner.email" : "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e48189858d88a48189855b79">[email protected]</a>",
"Item.tags" : [
"tag1",
"tag2",
"teg3"
]
},
]
Next, picture a text input with ng-model="search"
and a
ng-repeat="product in products | filter: search"
.
While this setup allows searching through all data, there may be cases where you want to limit the search to specific fields like Item.ad_title
, publication.publication_text
, Transaction.price
, and Item.tags
.
Is there a way to instruct Angular to focus the search on these particular fields only?
Edit: The goal is for this to be achieved using a single search input field.