首页 > 解决方案 > How to filter a list only by name - AngularJS

问题描述

So I need to implement a search filter, just by name. I am not good with angularjs so I could use some help. This is what I did for now, but it needs a bit of tweaking:

<input type="text" ng-model="searchText" placeholder="Search for a pupil..." />

<tr ng-repeat="student in studentData | filter : searchText">

just this filter. But in studentData, i should search through studentData.FullName only. What is the easiest way to do this?

标签: angularjs

解决方案


检查下面的代码..

<input type="text" ng-model="searchText" placeholder="Search for a pupil..." />

<tr ng-repeat="student in studentData | filter :{name:searchText}:true">

推荐阅读