1
Answer

Angular.js filter function

Lucy Song

Lucy Song

5y
393
1

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)