<!DOCTYPE html> <html> <head> <Meta charset="UTF-8"> <title></title> <script src="js/angular.js"></script> </head> <body> <div ng-app="" ng-init="firends=[ {name:'tome',age:16},{name:'jerry',age:20},{name:'gafiored',age:22} ]"> 输入条件:<input type="text" ng-model="name" /> 输出结果: <ul style="list-style-type: none;"> <li ng-repeat="x in firends|filter:name"> {{x.name+","+x.age}} </li> </ul> </div> </body> </html>