Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit d674dbf

Browse files
author
Barrie Hadfield
committed
example working
1 parent 5c7f9f5 commit d674dbf

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,19 @@ index.html:
9090
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/hyperloop.min.js"></script>
9191

9292
<script type="text/ruby">
93-
class SayHello < Hyperloop::Component
94-
param :name
95-
render(div) do
96-
10.times do
97-
h1 { "Hello #{params.name}! " }
93+
class SimpleComponent < Hyperloop::Component
94+
render(DIV) do
95+
BUTTON { 'Push the button' }.on(:click) do
96+
alert 'You did it!'
9897
end
9998
end
10099
end
101100
</script>
102101
</head>
103102

104103
<body>
105-
<div data-hyperloop-mount="SayHello"
106-
data-name="World">
107-
</div>
104+
<div data-hyperloop-mount="SimpleComponent">
105+
</div>
108106
</body>
109107
</html>
110108
```

index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7-
<title>Hyperloop JS Demo</title>
7+
<title>Hyperloop-JS Demo</title>
88

99
<!-- React and JQuery -->
1010
<script src="https://unpkg.com/react@15/dist/react.min.js"></script>
@@ -16,18 +16,18 @@
1616
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/hyperloop.min.js"></script>
1717

1818
<script type="text/ruby">
19-
class SimpleComponent < Hyperloop::Component
20-
render(DIV) do
21-
BUTTON { 'Push the button' }.on(:click) do
22-
alert 'You did it!'
19+
class SimpleComponent < Hyperloop::Component
20+
render(DIV) do
21+
BUTTON { 'Push the button' }.on(:click) do
22+
alert 'You did it!'
23+
end
2324
end
2425
end
25-
end
2626
</script>
2727
</head>
2828

2929
<body>
30-
<div data-hyperloop-mount="SimpleComponent">
31-
</div>
30+
<div data-hyperloop-mount="SimpleComponent">
31+
</div>
3232
</body>
3333
</html>

0 commit comments

Comments
 (0)