-
Notifications
You must be signed in to change notification settings - Fork 0
/
freelance_calc.html
50 lines (46 loc) · 1.47 KB
/
freelance_calc.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
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="lib/jasmine.css"/>
<script type="text/javascript" src="lib/jquery-1.11.2.js"></script>
<script type="text/javascript" src="lib/lodash.min.js"></script>
<script type="text/javascript" src="bin/frontbone.js"></script>
<script type="text/javascript">
$(function () {
ViewModel.create({
el: 'body',
autoParseBinds: true,
initialize: function () {
},
course: Observable(0),
dollarsPerHour: Observable(0)
}, {
model: Model.create({
defaults: {
value: 10
},
computed: {
valueX2: {
deps: ['value'],
get: function (value) {
return value * 2;
},
set: function (value) {
this.prop('value', value / 2);
}
}
}
})
});
});
</script>
</head>
<body>
<div data-bind="withModel: model">
<input type="text" data-bind="value: value"/>
<input type="text" data-bind="value: valueX2 "/>
</div>
</body>
</html>