Skip to content

Commit 05f3045

Browse files
committed
docs(examples): First examples
1 parent 0bbef0f commit 05f3045

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

examples/controller.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function TestController() {
2+
this.projects = [
3+
{name: "AngularJS", version: "1.5", language: "JavaScript", maintainer: "Google", stars: 35000},
4+
{name: "Bootstrap", version: "3.3", language: "CSS", maintainer: "Twitter", stars: 23000},
5+
{name: "UI-Router", version: "0.13", language: "JavaScript", maintainer: "AngularUI", stars: 15000}
6+
];
7+
}
8+
9+
angular.module('app', ['wt.responsive'])
10+
.controller('TestController', TestController);

examples/index.html

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<!DOCTYPE html>
2+
<html ng-app="app">
3+
<head>
4+
<script src="../bower_components/angular/angular.js"></script>
5+
<script src="../release/angular-responsive-tables.js"></script>
6+
<script src="controller.js"></script>
7+
<link rel="stylesheet" href="../src/style.css">
8+
</head>
9+
<body ng-controller="TestController as ctrl">
10+
<h1>Angular Responsive Tables</h1>
11+
12+
<h2>Static table</h2>
13+
<table wt-responsive-table>
14+
<thead>
15+
<tr>
16+
<th>Name</th>
17+
<th>Version</th>
18+
<th>Language</th>
19+
<th>Maintainer</th>
20+
<th>Stars</th>
21+
</tr>
22+
</thead>
23+
<tbody>
24+
<tr>
25+
<td>AngularJS</td>
26+
<td>1.5</td>
27+
<td>JavaScript</td>
28+
<td>Google</td>
29+
<td>35000</td>
30+
</tr>
31+
<tr>
32+
<td>Bootstrap</td>
33+
<td>3.3</td>
34+
<td>CSS</td>
35+
<td>Twitter</td>
36+
<td>23000</td>
37+
</tr>
38+
<tr>
39+
<td>UI-Router</td>
40+
<td>0.13</td>
41+
<td>JavaScript</td>
42+
<td>AngularUI</td>
43+
<td>15000</td>
44+
</tr>
45+
</tbody>
46+
</table>
47+
48+
<h2>Simple table with ng-repeat</h2>
49+
<table wt-responsive-table>
50+
<thead>
51+
<tr>
52+
<th>Name</th>
53+
<th>Version</th>
54+
<th>Language</th>
55+
<th>Maintainer</th>
56+
<th>Stars</th>
57+
</tr>
58+
</thead>
59+
<tbody>
60+
<tr ng-repeat="item in ctrl.projects">
61+
<td>{{item.name}}</td>
62+
<td>{{item.version}}</td>
63+
<td>{{item.language}}</td>
64+
<td>{{item.maintainer}}</td>
65+
<td>{{item.stars}}</td>
66+
</tr>
67+
</tbody>
68+
</table>
69+
70+
<h2>Simple table with no thead, tbody</h2>
71+
<table wt-responsive-table>
72+
<tr>
73+
<th>Name</th>
74+
<th>Version</th>
75+
<th>Language</th>
76+
<th>Maintainer</th>
77+
<th>Stars</th>
78+
</tr>
79+
<tr ng-repeat="item in ctrl.projects">
80+
<td>{{item.name}}</td>
81+
<td>{{item.version}}</td>
82+
<td>{{item.language}}</td>
83+
<td>{{item.maintainer}}</td>
84+
<td>{{item.stars}}</td>
85+
</tr>
86+
</table>
87+
</body>
88+
</html>

0 commit comments

Comments
 (0)