Repository navigation
Expand file tree
/
Copy pathtest.html
More file actions
74 lines (67 loc) · 1.79 KB
/
Copy pathtest.html
File metadata and controls
74 lines (67 loc) · 1.79 KB
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
<!doctype html>
<html>
<head>
</head>
<body data-ng-app="test">
<ul data-hyper=".users">
{{users}}
<li data-ng-repeat="user in users">
<h3 data-hyper-bind="user.given-name"></h3>
</li>
</ul>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular-mocks.js"></script>
<script src="./build/build.js"></script>
<script>
BROWSER_ENV = 'development';
require('ng-hyper');
var app = angular.module('test', ['ng-hyper', 'ng-hyper-cj']);
app.provider({
'$httpBackend': angular.mock.$HttpBackendProvider
});
var root = {
href: '/api',
username: 'Joe',
users: {href: '/api/users'}
};
var users = {
collection: {
version: '1.0',
items: [
{
href: '/api/users/123',
data: [
{name: 'given-name', value: 'Joe'}
],
links: []
},
{
href: '/api/users/456',
data: [
{name: 'given-name', value: 'Mike'}
],
links: []
},
{
href: '/api/users/789',
data: [
{name: 'given-name', value: 'Robert'}
],
links: []
}
]
}
}
app.run([
'$httpBackend',
function(http) {
http.whenGET('/api').respond(root);
http.whenGET('/api/users').respond(users, {'content-type': 'application/collection+json'});
setTimeout(function(){
http.flush();
}, 100);
}
]);
</script>
</body>
</html>