-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·40 lines (37 loc) · 1.44 KB
/
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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>index</title>
<script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js"></script>
<script src="testViewModel.js"></script>
<link rel="stylesheet" type="text/css" href="../ko-inspector.css">
<script type="text/javascript" src="../ko-inspector.bindingHandler.js"></script>
<script type="text/javascript" src="../ko-inspector.comparer.js"></script>
<script type="text/javascript" src="../ko-inspector.dirtyFlag.js"></script>
<script type="text/javascript" src="../ko-inspector.global.js"></script>
<script type="text/javascript" src="../ko-inspector.guid.js"></script>
<script type="text/javascript" src="../ko-inspector.renderer.js"></script>
</head>
<body>
<button data-bind="click:changeStuff">Change stuff</button>
<div data-bind="inspect: $data"></div>
</body>
<script>
window.onload = function () {
var myRecurringObject = { value: 1 };
var viewModel = {
arr: ko.observableArray([
{ value: 0 },
myRecurringObject,
{ value: 3 }
]),
selected: ko.observable(myRecurringObject),
someOtherThingAfterTheRecurringObject: ko.observable(false)
};
viewModel.changeStuff = function(){
viewModel.someOtherThingAfterTheRecurringObject(!viewModel.someOtherThingAfterTheRecurringObject());
};
ko.applyBindings(viewModel);
};
</script>
</html>