Skip to content

Commit cfd213d

Browse files
Zhuk, AlexanderZhuk, Alexander
authored andcommitted
THE START: sample page added
1 parent 30ecd95 commit cfd213d

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

index.html

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title>Flat JSON format for data tables</title>
6+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
7+
</head>
8+
<body>
9+
<div class="container" ng-app="myApp" ng-controller="myAppController" ng-cloak>
10+
<h1>Flat JSON format for data tables</h1>
11+
12+
<div class="row">
13+
<table class="table table-hover">
14+
<th>
15+
First Name
16+
</th>
17+
<th>
18+
Second Name
19+
</th>
20+
<tr ng-repeat="item in items">
21+
<td>{{item.id}}</td>
22+
<td>{{item.title}}</td>
23+
</tr>
24+
</table>
25+
</div>
26+
27+
</div>
28+
</body>
29+
30+
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
31+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
32+
<script type="text/javascript" src="https://s7.landsend.com/s7viewers/html5/js/BasicZoomViewer.js"></script>
33+
<script>
34+
35+
angular.module('myApp', [])
36+
.controller('myAppController', ['$scope', 'myAppFactory', function ($scope, myAppFactory) {
37+
$scope.getData = function () {
38+
myAppFactory.getData()
39+
.success(function (response) {
40+
$scope.items = response;
41+
}).error(function () {
42+
});
43+
};
44+
$scope.getData();
45+
}])
46+
.factory('myAppFactory', function ($http) {
47+
var root = 'http://jsonplaceholder.typicode.com';
48+
return {
49+
getData: function () {
50+
return $http.get(root + '/posts', {});
51+
},
52+
postData: function (data) {
53+
return $http.post(contextPath + '/stores/' + storeId + '/rest/payment-method', data);
54+
}
55+
}
56+
});
57+
</script>
58+
</html>

0 commit comments

Comments
 (0)