Lucy Song

Lucy Song

  • NA
  • 3
  • 369

Angular.js filter function

Jul 26 2019 1:09 PM

I am having an issue wih Angular.js filter function. I have a user object which has the following properties:Id (int) FirstName (string) LastName (string) Selected (boolean)


I want use the "searchText" from search box to ONLY search for user object's FirstName and LastName to find a match. It should NOT search for "Id", "Selected" properties. The way I wrote now below, it also search for the Id and Selected fields.
 
li.animate-repeat(role='menuitem', ng-repeat='user in userlist I filter:searchText: user.FirstName II user.LastName' ng-if="searchText")
Is anyone can help me with this?
Thanks,
Lucy


Answers (1)