<! DOCTYPE html>
<meta charset= "Utf-8" >
<meta http-equiv= "x-ua-compatible" content= "Ie=edge" >
<title></title>
<link rel= "stylesheet" href= "" >
<body>
<div ng-app= "myApp" ng-controller= "Namesctrl" >
<p><input type= "text" ng-model= "test" ></p>
<ul>
<li ng-repeat= "x in Names | Filter:test | By: ' Country ' >
{{(X.name | uppercase) + ', ' + X.country}}
</li>
</ul>
</div>
</body>
<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 ("Namesctrl", function ($scope) {
$scope. Names = [
{name: ' Lili ', Country: ' Norway '},
{name: ' Xiao ', Country: ' Sweden '},
{name: ' Mimin ', Country: ' Denmark '}
];
});
</script>
This article is from the "Yan" blog, please be sure to keep this source http://suyanzhu.blog.51cto.com/8050189/1895298
angularjs-Filtering Input Filter