-
Notifications
You must be signed in to change notification settings - Fork 0
/
Filters.html
26 lines (25 loc) · 870 Bytes
/
Filters.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
<html ng-app>
<head>
<title>Filters</title>
<script src = 'angular.js'></script>
</head>
<body ng-init = "customers=[{joined: '2000-12-02', name:'John', city:'Chandler', orderTotal: 9.9956}, {joined: '1965-01-25',name:'Zed', city:'Las Vegas', orderTotal: 19.99},{joined: '1944-06-15',name:'Tina', city:'New York', orderTotal:44.99}, {joined: '1995-03-28',name:'Dave', city:'Seattle', orderTotal:101.50}]">
<h2>Customers</h2>
Filter: <input type = "text" ng-model = 'customerFilter.name'/>
<br/><br/>
<table>
<tr>
<th>Name</th>
<th>City</th>
<th>Total</th>
<th>Joined</th>
</tr>
<tr ng-repeat = "cust in customers | filter:customerFilter | orderBy:'name'">
<td>{{cust.name | uppercase}}</td>
<td>{{cust.city | lowercase}}</td>
<td>{{cust.orderTotal | currency}}</td>
<td>{{cust.joined | date}}</td>
</tr>
</table>
</body>
</html>