<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script src="http://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js"></script>
</head> <body>
<div ng-app="myApp" ng-controller="myCtl">
输入过滤字符:<input type="text" ng-model="test">
<ul>
<li ng-repeat="x in names | filter:test | orderBy:'firstname'">
{{x.firstname+','+x.lastname}}
</li>
</ul>
</div>
<script>
var app=angular.module("myApp",[]);
app.controller("myCtl",function($scope){
$scope.names=[{firstname:'john',lastname:'cena'},{firstname:'bill',lastname:'gates'}];
});
</script>
</body>
</html>