大佬教程收集整理的这篇文章主要介绍了模糊查询,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<!DOCTYPE html> <html lang="en" ng-app="myApp"> <head> <Meta charset="UTF-8"> <title>title</title> <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script> <script> var app = angular.module('myApp',[]); app.controller("myControl",function($scopE){ $scope.friends = [ {name:'aaa',phone:'110'},{name:'bbb',phone:'119'},{name:'ccc',phone:'120'},{name:'ddd',{name:'eee',phone:'114'},{name:'fff',phone:'911'},{name:'ggg',phone:'10010'},{name:'hhh',phone:'10086'} ] }); </script> </head> <body ng-app="myApp" ng-controller="myControl"> <label>Search:<input ng-model="searchText"></label> <table id="searchTextResult"> <tr><th>name</th><th>phone</th></tr> <tr ng-repeat="friend in friends | filter:searchText"> <!-- 向表达式添加过滤器:可以通过一个管道字符(|)和一个过滤器添加到表达式中--> <!-- filter:searchText 模糊查询 --> <td>{{friend.namE}}</td> <td>{{friend.phonE}}</td> </tr> </table> </body> </html>
以上是大佬教程为你收集整理的模糊查询全部内容,希望文章能够帮你解决模糊查询所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。