-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkbox.html
54 lines (54 loc) · 1.11 KB
/
checkbox.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
<!doctype html>
<html>
<head>
<script src="../polymer/polymer.js"></script>
</head>
<body>
<element name="x-foo" attributes="data">
<template>
<input type="checkbox" checked="{{data.checked}}">
checked: {{data.checked}}
</template>
<script>
Polymer.register(this, {
data: {
checked: false
},
toggle: function() {
this.data.checked = !this.data.checked;
console.log(JSON.stringify(this.data));
}
});
</script>
</element>
<element name="x-foo-list">
<template>
<template repeat="{{data}}">
<x-foo data="{{}}"></x-foo>,
<!--<input type="checkbox" checked="{{checked}}">//-->
data: {{checked}}
<br>
</template>
<x-foo data="{{data.0}}"></x-foo>,
data: {{data.0.checked}}
<br>
<x-foo data="{{data.1}}"></x-foo>,
data: {{data.1.checked}}
<br>
</template>
<script>
Polymer.register(this, {
data: [{
checked: false
}, {
checked: true
}]
});
</script>
</element>
<div>
<x-foo-list id="foolist"></x-foo-list><br>
<!--<x-foo></x-foo>//-->
</div>
</body>
</html>