Filter in AngularJs
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script>
var app=angular.module('myApp',[]);
app.controller('ct',function($scope){
$scope.arr=["Shiv","Jagan"];
});
</script>
</head>
<body>
<div ng-app="myApp"
id="u" ng-controller="ct">
Name<input type="text"
ng-model="userName"/>
<ul>
<li ng-repeat="x in
arr|filter:userName">
User Name:{{x}}
</ul>
</div>
0 comments: