-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhal.html
68 lines (62 loc) · 2.6 KB
/
hal.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
<html>
<head>
<meta charset="utf-8">
<title>traverson-angular HAL example</title>
<link rel="stylesheet" type="text/css" href="assets/bootstrap.min.css">
</head>
<body>
<div class="container" ng-app="traverson-angular-hal-example">
<div class="jumbotron">
<h1>traverson-angular with HAL</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
demonstrates how to use traverson-angular together with media type
plug-ins like traverson-hal. This example talks to the local Traverson
test server.</p>
<p>There is also the
<a href="index.html">more comprehensive example without HAL</a>, an
example using the <a href="github.html">GitHub API 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>Setup</h2>
<div ng-controller="generalSetup" ng-bind-html="code">
<img src="assets/spinner.gif"/>
</div>
<hr>
<h2>Working with HAL</h2>
<div class="row" ng-controller="halController">
<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="assets/traverson-hal.min.js"></script>
<script src="hal.js"></script>
</body>
</html>