-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
62 lines (48 loc) · 2.1 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Knockout WebComponents demo</title>
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>
<link href="src/css/style.css" rel="stylesheet">
</head>
<body>
<div class="main-container">
<div class="container left-container">
<div class="container-header">
ViewModel demo
</div>
<div class="container-body" data-bind="with: vm">
<ul data-bind="foreach: people">
<li data-bind="style: { 'text-decoration': retired() ? 'line-through' : '' } ">
[<span data-bind="text: id"></span>] <span data-bind="text: firstname"></span> <a href="#" data-bind="click: $parent.delete">(x)</a>
</li>
</ul>
<button data-bind="click: add">Add</button>
<div style="margin-top: 20px;">
<select data-bind="value: selectedPerson, options: people, optionsText: 'firstname'"></select>
<div data-bind="with: selectedPerson">
First name: <input type="text" data-bind="textInput: firstname">
Last name: <input type="text" data-bind="textInput: lastname">
<input type="checkbox" data-bind="checked: retired" id="retired-cb"><label for="retired-cb">Retired</label>
</div>
</div>
</div>
</div>
<div class="container right-container">
<div class="container-header">
App demo
<button data-bind="click: openView.bind(null, 1)">Wired Elements</button>
<button data-bind="click: openView.bind(null, 2)">Material Design WC</button>
<button data-bind="click: openView.bind(null, 3)">Ionic</button>
<button data-bind="click: openView.bind(null, 4)">Weightless</button>
</div>
<div class="container-body" data-bind="with: vm">
<div data-bind="template: {nodes: ko.utils.parseHtmlFragment(html())}"></div>
</div>
</div>
</div>
<script type="text/javascript" src="dist/index.js"></script>
</body>
</html>