forked from Polymer/polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdom-if.html
70 lines (56 loc) · 1.44 KB
/
dom-if.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
68
69
70
<!doctype html>
<html>
<head>
<title>dom-if</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../../polymer.html">
<link rel="import" href="../../src/lib/template/dom-if.html">
</head>
<body>
<dom-module id="x-test">
<style>
.content {
border: 1px dashed orange;
margin: 8px;
padding: 8px;
}
</style>
<template>
if <input type="checkbox" checked="{{checked::change}}">
<br><br>
<input value="{{value::input}}">
<template is="dom-if" id="if1" if="[[checked]]">
<h3>Lazy / hidden</h3>
Text node
<div class="content" style="display: inline-block;">
<div>I have been <input value="{{value::input}}"></div>
</div>
Text node
</template>
<template is="dom-if" id="if2" if="[[checked]]" restamp>
<h3>Restamp</h3>
Text node
<div class="content" style="display: inline-block;">
<div>I have been <input value="{{value::input}}"></div>
</div>
Text node
</template>
</template>
</dom-module>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'x-test',
properties: {
value: {
value: 'stamped!'
}
}
});
});
</script>
<x-test></x-test>
</body>
</html>