forked from riot/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
40 lines (32 loc) · 937 Bytes
/
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
<!doctype html>
<html>
<head>
<title>Observable Example: Observables</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body>
<car-key></car-key>
<car-headlights></car-headlights>
<!-- riot tags -->
<script type="riot/tag" src="car-key.tag"></script>
<script type="riot/tag" src="car-headlights.tag"></script>
<!-- scripts we need -->
<script src="https://rawgit.com/riot/riot/master/riot%2Bcompiler.min.js"></script>
<!-- mount this app -->
<script type="text/javascript">
function Car(make, model) {
var self = this
self.make = make
self.model = model
self.started = false
riot.observable(self)
self.on('start', function () {
self.started = true
})
}
// make a new Car instance
var car = new Car('Ford', 'Focus')
riot.mount('*')
</script>
</body>
</html>