angularjs - 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?
解决方案
检查下面的代码..
<input type="text" ng-model="searchText" placeholder="Search for a pupil..." />
<tr ng-repeat="student in studentData | filter :{name:searchText}:true">
推荐阅读
- php - 如何在准备好的语句中绑定“DEFAULT”和“NULL”?
- node.js - 如何测试已触发的事件及其值?
- firebase - firebase 功能无法部署
- javascript - ReferenceError Html 和 JavaScript
- css - 为什么 svg 在重新加载时会显示调整大小(以一种不受欢迎的方式),但在强制重新加载时会正确呈现?
- php - 从 FTP 下载文件,同时保留原始的“最后更改”日期
- javascript - 钩画布的 toDataURL
- java - Java - 将泛型类型映射到所述类型的使用者
- r - 提取单元格组合而不重复索引
- frama-c - Frama-C EVA插件中“后”栏的含义和目的是什么