-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearch-Filter.html
39 lines (39 loc) · 1.25 KB
/
Search-Filter.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!doctype html>
<html ng-app="EmpMod">
<head>
<title>Example to use search filter in AngularJS?</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
<script type="text/javascript">
var EmpMod = angular.module('EmpMod', []);
EmpMod.controller('EmpCtrl', function ($scope) {
$scope.Employees = [
{'EmpName': 'Manmohan Mohanty'},
{'EmpName': 'Nursingh Sahoo'},
{'EmpName': 'Javed Khan'},
{'EmpName': 'Altamash Bhagwan'},
{'EmpName': 'Priya Yeotikar'},
{'EmpName': 'Pratap Mishra'},
{'EmpName': 'Tapan Rath'},
{'EmpName': 'Mamta Kamble'},
{'EmpName': 'Satish Sharma'},
{'EmpName': 'Ajay Mohanty'},
{'EmpName': 'Deepak Tamboli'},
{'EmpName': 'Chinmayee Choudhury'},
{'EmpName': 'Sanjarekha Dash'},
{'EmpName': 'Suman Koiri'},
{'EmpName': 'Tapash Mishra'}
];
});
</script>
</head>
<body ng-controller="EmpCtrl">
<div style="float:left;"><h2>Search Filter using AngularJS</h2></div>
<div style="float:right;"><img src="../images/infosys.gif" alt="Infosys" title="Infosys" style="width:420px;" /></div>
<div style="clear:both;"></div>
<hr />
Search Employees: <input ng-model="query">
<ul>
<li ng-repeat="Employee in Employees | filter:query">{{Employee.EmpName}}</li>
</ul>
</body>
</html>