AngularJS实现文本框输入关键字自动筛选查找功能可以使用filter数据过滤
1、静态页面
<div ng-controller="personCtrl">
<input type="text" ng-model="nameText" placeholder="输入过滤信息..." />
<p class="animate-repeat" ng-repeat="info in names | filter:nameText">
{{$index+1}}、{{info.name}} {{info.num}}!
{{$first}}-{{$middle}}-{{$last}}-{{$even}}-{{$odd}}
</p>
</div>
2.js代码
<script type="text/javascript">
angular.module('myApp', []).controller('personCtrl', function($scope) {
$scope.names=[
{name: 'a jQuery', num:'25'},
{name: 'b JavaScript', num:'40'},
{name: 'c angular', num:'25'},
{name: 'd vue', num:'98'}
]
});
</script>