-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (57 loc) · 1.98 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
63
64
65
66
67
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>app</title>
<link rel="stylesheet" href="style.css">
<script src="live-tpl.js"></script>
</head>
<body>
<div id="app" class="invis">
<input [type]="textStr" tpl-model="str">
<p>text rendering: {{str}}</p>
<button onclick="toggleBool()">toggle bools</button>
<p>conditional rendering: <span tpl-if="bool">i am invisible</span></p>
<p>conditional rendering: <span tpl-if="!bool">i am visible</span></p>
<p>nested loop with following array: {{obj.nestedArr}}</p>
<ul>
<li tpl-for="obj.nestedArr; x">
{{x}}
<ul>
<li tpl-for="x; y">
{{y}}
</li>
</ul>
</li>
</ul>
<p>loop with following array: {{obj.arr}}</p>
<button onclick="addClick()">add</button>
<button onclick="modClick()">modify</button>
<button onclick="delClick()">remove</button>
<ul>
<li tpl-for="obj.arr; x">
{{x}}
</li>
</ul>
<hr>
<div tpl-for="arr1; x">
<div tpl-for="x.arr2; y">
<input type="number" tpl-model="y">
</div>
<div tpl-for="arr3; z">
<input tpl-model="z">
</div>
</div>
<div tpl-for="arr1; x">
<div tpl-for="x.arr2; y">
<p>{{y}}</p>
</div>
<div tpl-for="arr3; z">
<p>{{z}}</p>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>