-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbasic-example.html
More file actions
76 lines (67 loc) · 2.89 KB
/
basic-example.html
File metadata and controls
76 lines (67 loc) · 2.89 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ngTable - Example</title>
<script src="../angular.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/esvit/ng-table/1.0.0/dist/ng-table.min.css">
<script src="https://cdn.rawgit.com/esvit/ng-table/1.0.0/dist/ng-table.js"></script>
<script type="text/javascript">
(function (angular) {
'use strict';
angular.module('exampleApp', ["ngTable"]).
controller('EventController', ['$scope', 'NgTableParams', function ($scope, NgTableParams) {
var self = this;
var data = [
{name: "Moroni", age: 50},
{name: "Simon", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Christian", age: 34},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Moroni", age: 50},
{name: "Simon", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Christian", age: 34},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Moroni", age: 50},
{name: "Simon", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Christian", age: 34},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Christian", age: 34},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Moroni", age: 50},
{name: "Simon", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Christian", age: 34},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27}
];
self.tableParams = new NgTableParams({count: 10}, { dataset: data});
}]);
})(window.angular);
</script>
</head>
<body ng-app="exampleApp">
<div ng-controller="EventController as vm">
<table ng-table="vm.tableParams" class="table" show-filter="true">
<tr ng-repeat="user in $data" class="animate">
<td title="'Name'" filter="{ name: 'text'}" sortable="'name'">
{{user.name}}</td>
<td title="'Age'" filter="{ age: 'number'}" sortable="'age'">
{{user.age}}</td>
</tr>
</table>
</div>
</body>
</html>