-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilter5.html
More file actions
28 lines (27 loc) · 785 Bytes
/
filter5.html
File metadata and controls
28 lines (27 loc) · 785 Bytes
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
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<script>
var app1=angular.module("myapp",[]);
app1.controller("myctrl",function($scope){
$scope.details=[{name:'ridhima',color:'red'},{name:'sajal',color:'blue'},{name:'surya',color:'pink'},{name:'avinash',color:'orange'}];
$scope.fun1=function(x){
$scope.orderby=x;
}
});
</script>
</head>
<body ng-app="myapp" ng-controller="myctrl">
<table border="1px" cellspacing="0px">
<tr>
<th ng-click="fun1('name')">name</th>
<th ng-click="fun1('color')">color</th>
</tr>
<tr ng-repeat="x in details|orderBy:orderby">
<td>{{x.name}}</td>
<td>{{x.color}}</td>
</tr>
</table>
</body>
</html>