This repository was archived by the owner on Oct 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -90,21 +90,19 @@ index.html:
90
90
< script src= " https://rawgit.com/ruby-hyperloop/hyperloop-js/master/hyperloop.min.js" >< / script>
91
91
92
92
< 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!'
98
97
end
99
98
end
100
99
end
101
100
< / script>
102
101
< / head>
103
102
104
103
< body>
105
- < div data- hyperloop- mount= " SayHello"
106
- data- name= " World" >
107
- < / div>
104
+ < div data- hyperloop- mount= " SimpleComponent" >
105
+ < / div>
108
106
< / body>
109
107
< / html>
110
108
```
Original file line number Diff line number Diff line change 4
4
< head >
5
5
< meta charset ="utf-8 ">
6
6
< meta http-equiv ="X-UA-Compatible " content ="IE=edge,chrome=1 ">
7
- < title > Hyperloop JS Demo</ title >
7
+ < title > Hyperloop- JS Demo</ title >
8
8
9
9
<!-- React and JQuery -->
10
10
< script src ="https://unpkg.com/react@15/dist/react.min.js "> </ script >
16
16
< script src ="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/hyperloop.min.js "> </ script >
17
17
18
18
< 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
23
24
end
24
25
end
25
- end
26
26
</ script >
27
27
</ head >
28
28
29
29
< body >
30
- < div data-hyperloop-mount ="SimpleComponent ">
31
- </ div >
30
+ < div data-hyperloop-mount ="SimpleComponent ">
31
+ </ div >
32
32
</ body >
33
33
</ html >
You can’t perform that action at this time.
0 commit comments