Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:09:39+00:00 2026-06-13T18:09:39+00:00

Take a look at the example here: http://docs.angularjs.org/api/ng.filter:filter You can search by any of

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:09:42+00:00Added an answer on June 13, 2026 at 6:09 pm

    Here is the plunker

    New plunker with cleaner code & where both the query and search list items are case insensitive

    Main idea is create a filter function to achieve this purpose.

    From official doc

    function: A predicate function can be used to write arbitrary filters.
    The function is called for each element of array. The final result is
    an array of those elements that the predicate returned true for.

    <input ng-model="query">
    
    <tr ng-repeat="smartphone in smartphones | filter: search "> 
    

    $scope.search = function(item) {
        if (!$scope.query || (item.brand.toLowerCase().indexOf($scope.query) != -1) || (item.model.toLowerCase().indexOf($scope.query.toLowerCase()) != -1) ){
            return true;
        }
        return false;
    };
    

    Update

    Some people might have a concern on performance in real world, which is correct.

    In real world, we probably would do this kinda filter from controller.

    Here is the detail post showing how to do it.

    in short, we add ng-change to input for monitoring new search change

    and then trigger filter function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take a look at this example here: http://denise.brixwork.com/showlisting/1/8297-Valley-Drive-Alpine-Meadows-Whistler-denise-brown-real-estate And the red tables under Specifications
Take a look at the example here: http://www.brianhare.com/physics/so.html Take a look at console.log where
Take a look at this example: http://www.extjs.com/deploy/dev/examples/multiselect/multiselect-demo.html On it, there are components rendered against
Take a look at my code example at js bin: http://jsbin.com/iritep/3/edit I'd like to
Example: http://bit.ly/dfjvmT If you take a look at that URL, you will see an
take look at this: http://www.templatemonster.com/demo/35403.html In this template you can click on the image
Take a look at this: http://thebekker.dk/_skole/GFeksamen/ You can see the 2nd menu item show
Take a look here: http://jsfiddle.net/ELKHq/ , now I would like to set up minimum
Please take a look here: http://www.binarymark.com/Products/FLVDownloader/order.aspx What I am trying to do is to
For example, take a look at http://www.google.com/webfonts/specimen/Open+Sans . Inspect the type, change the font

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.