-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
65 lines (47 loc) · 1.42 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
<!DOCTYPE html>
<html>
<head>
<title>grapp-rest-resource web component</title>
<script src='lib/webcomponentsjs/webcomponents-lite.min.js'></script>
<link rel="import" href="build/grapp-rest-resource.html">
</head>
<body>
<h1>grapp-rest-resource web component</h1>
<h2>A web component that encapsulates REST API calls</h2>
<p>
<a href="test/index.html">Click here to run the tests...</a>
</p>
<p>
<a href="README.md">Click here to read the documentation...</a>
</p>
<p>
<a href="CHANGELOG.md">Click here to read the changelog...</a>
</p>
<h2>Demo</h2>
<dom-module id="demo-element">
<template>
<grapp-rest-resource id="data" url="/abc" path="/example_data"></grapp-rest-resource>
<div>Response code: <span>[[status]]</span></div>
<template is="dom-repeat" items="[[items]]">
<p>
<span>{{item.name}}</span>: <span>{{item.role}}</span>
</p>
</template>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'demo-element',
ready: function() {
this.$.data.resource.index().then(function(response) {
this.items = response.data;
this.status = response.status;
}.bind(this));
}
});
});
</script>
</dom-module>
<demo-element></demo-element>
<script src="//localhost:35729/livereload.js"></script>
</body>