-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.html
More file actions
25 lines (22 loc) · 815 Bytes
/
example.html
File metadata and controls
25 lines (22 loc) · 815 Bytes
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript" src="node_modules/backbone/node_modules/underscore/underscore.js"></script>
<script type="text/javascript" src="node_modules/backbone/backbone.js"></script>
<script type="text/javascript" src="node_modules/baconjs/dist/Bacon.js"></script>
<script type="text/javascript" src="dist/backbacon.js"></script>
</script>
<script type="text/javascript">
Person = Backbone.Model.extend({});
p = new Person();
ageChange = p.asEventStream('change:age');
ageChangeIds = ageChange.map('.cid');
ageChangeIds.onValue(function(cid) { alert('This model change event from model ' + cid + ' arrived through bacon.js'); });
p.set('age', 34);
</script>
</body>
</html>