Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 6 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
17 demos/1-simple-data-bind-initial.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Simple data bind</title>
+ <link rel="stylesheet" href="../bootstrap.min.css" />
+ <link rel="stylesheet" href="../style.css" />
+ <script src="../knockout-2.0.0.js"></script>
+</head>
+<body>
+ <div class="container">
+ <h1>Simple data bind</h1>
+ <p>Hello, World!</p>
+ <script>
+ </script>
+ </div>
+</body>
+</html>
View
18 demos/2-simple-observable-initial.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Simple observable</title>
+ <link rel="stylesheet" href="../bootstrap.min.css" />
+ <link rel="stylesheet" href="../style.css" />
+ <script src="../knockout-2.0.0.js"></script>
+</head>
+<body>
+ <div class="container">
+ <h1>Simple observable</h1>
+ <p>Hello, <span data-bind="text: name"></span>!</p>
+ <script>
+ ko.applyBindings({name: 'World'});
+ </script>
+ </div>
+</body>
+</html>
View
4 demos/2-simple-observable.html
@@ -11,10 +11,10 @@
<h1>Simple observable</h1>
<p>Hello, <span data-bind="text: name"></span>!</p>
<script>
- var person = {
+ window.person = {
name: ko.observable('World')
};
- ko.applyBindings(person);
+ ko.applyBindings(window.person);
</script>
</div>
</body>
View
19 demos/3-counter-initial.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Simple counter</title>
+ <link rel="stylesheet" href="../bootstrap.min.css" />
+ <link rel="stylesheet" href="../style.css" />
+ <script src="../knockout-2.0.0.js"></script>
+</head>
+<body>
+ <div class="container">
+ <h1>Simple counter</h1>
+ <p>You have clicked the button
+ <span>0</span> times.</p>
+ <input type="button" class="btn" value="Click Me" />
+ <script>
+ </script>
+ </div>
+</body>
+</html>
View
5 demos/3-counter.html
@@ -16,11 +16,10 @@
var Counter = function () {
this.count = ko.observable(0);
this.increment = function () {
- var current = this.count();
- this.count(current + 1);
+ this.count(this.count() + 1);
};
};
- ko.applyBindings(new Counter());
+ ko.applyBindings(new Counter);
</script>
</div>
</body>
View
27 demos/4-counter-with-reset-initial.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Simple counter</title>
+ <link rel="stylesheet" href="../bootstrap.min.css" />
+ <link rel="stylesheet" href="../style.css" />
+ <script src="../knockout-2.0.0.js"></script>
+</head>
+<body>
+ <div class="container">
+ <h1>Counter with reset</h1>
+ <p>You have clicked the button
+ <span data-bind="text: count"></span> times.</p>
+ <input type="button" class="btn" value="Click Me" data-bind="click: increment" />
+ <input type="button" class="btn" value="Reset Count" />
+ <script>
+ var Counter = function () {
+ this.count = ko.observable(0);
+ this.increment = function () {
+ this.count(this.count() + 1);
+ };
+ };
+ ko.applyBindings(new Counter);
+ </script>
+ </div>
+</body>
+</html>
View
2 demos/4-counter-with-reset.html
@@ -11,7 +11,7 @@
<h1>Counter with reset</h1>
<p>You have clicked the button
<span data-bind="text: count"></span> times.</p>
- <input type="button" class="btn" value="Click Me" data-bind="click: increment" />
+ <input type="button" class="btn" value="Click Me" data-bind="click: increment" />
<input type="button" class="btn" value="Reset Count" data-bind="click: reset, visible: allowReset" />
<script>
var Counter = function () {
View
28 demos/5-todo-list-initial.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>Todo List</title>
+ <link rel="stylesheet" href="../bootstrap.min.css" />
+ <link rel="stylesheet" href="../style.css" />
+ <script src="../knockout-2.0.0.js"></script>
+</head>
+<body>
+ <div class="container">
+ <h1>Todo List</h1>
+ <ul id="todos">
+ <li>
+ <input type="checkbox">
+ <span>Take out the trash</span>
+ </li>
+ <li class="completed">
+ <input type="checkbox" checked>
+ <span>Walk the dog</span>
+ </li>
+ </ul>
+ <a href="#">Clear List</a>
+ <input type="text" placeholder="New Todo Title" />
+ </div>
+ <script>
+ </script>
+</body>
+</html>

No commit comments for this range

Something went wrong with that request. Please try again.