-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
107 lines (98 loc) · 3.87 KB
/
index.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<html>
<head>
<meta charset="utf-8">
<title>traverson-angular example</title>
<link rel="stylesheet" type="text/css" href="assets/bootstrap.min.css">
</head>
<body>
<div class="container" ng-app="traverson-angular-example" ng-controller="main">
<div class="jumbotron">
<h1>traverson-angular</h1>
<h2>AngularJS adapter for Traverson</h2>
<p><a href="https://github.com/traverson/traverson">Traverson</a> makes
it easy to work with REST/HATEOAS APIs. It works in Node.js as well as
in the browser. <strong>traverson-angular</strong> makes it easy to
integrate Traverson into your AngularJS application. This example talks
to the local Traverson test server.</p>
<p>There is also the <a href="github.html">GitHub API Example</a>, the
<a href="hal.html">HAL example</a> and an
<a href="browserify/index.html">example using traverson-angular with
Browserify</a>.
</p>
</div>
<small>
<p>
To run this example locally, you should start the test server contained
in the traverson-angular repository with
<tt>node bin/start-test-server.js</tt>.
This serves this page as well as the REST API that is used in the
examples. Open the URL
<a href="http://localhost:2808/static/browser/example"
>http://localhost:2808/static/browser/example</a>
in your browser. If the URL in your browser's address bar says
<tt>file:...</tt> the examples on this page will <em>not</em> work.
</p>
</small>
<h2>Configuration</h2>
<form class="form-horizontal">
<div class="form-group">
<label>
<input ng-model="config.use$http" type="checkbox"> Use AngularJS' $http instead of Traverson's HTTP module
</label>
</div>
</form>
<h2>Setup</h2>
<div ng-controller="generalSetup" ng-bind-html="code">
<img src="assets/spinner.gif"/>
</div>
<hr>
<h2>Plain Vanilla Link Following</h2>
<div class="row" ng-controller="plainVanillaController">
<div ng-bind-html="code" class="col-md-4">
<img src="assets/spinner.gif"/>
</div>
<div class="col-md-2">
<a ng-click="start()" class="btn btn-primary" role="button">Start Request</a>
</div>
<pre ng-bind="response" class="col-md-6"></pre>
</div>
<hr>
<h2>JSONPath</h2>
<div class="row" ng-controller="jsonPathController">
<div ng-bind-html="code" class="col-md-4">
<img src="assets/spinner.gif"/>
</div>
<div class="col-md-2">
<a ng-click="start()" class="btn btn-primary" role="button">Start Request</a>
</div>
<pre ng-bind="response" class="col-md-6"></pre>
</div>
<hr>
<h2>URI Templates</h2>
<div class="row" ng-controller="uriTemplateController">
<div ng-bind-html="code" class="col-md-4">
<img src="assets/spinner.gif"/>
</div>
<div class="col-md-2">
<a ng-click="start()" class="btn btn-primary" role="button">Start Request</a>
</div>
<pre ng-bind="response" class="col-md-6"></pre>
</div>
<h2>Post</h2>
<div class="row" ng-controller="postController">
<div ng-bind-html="code" class="col-md-4">
<img src="assets/spinner.gif"/>
</div>
<div class="col-md-2">
<a ng-click="start()" class="btn btn-primary" role="button">Start Request</a>
</div>
<pre ng-bind="response" class="col-md-6"></pre>
</div>
</div>
<script src="assets/jquery-2.0.2.min.js"></script>
<script src="assets/angular.js"></script>
<script src="assets/angular-sanitize.js"></script>
<script src="../dist/traverson-angular.js"></script>
<script src="traverson-angular-example.js"></script>
</body>
</html>