-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-repeat-bind.html
More file actions
43 lines (43 loc) · 961 Bytes
/
template-repeat-bind.html
File metadata and controls
43 lines (43 loc) · 961 Bytes
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
<!doctype html>
<html>
<head>
<link href="template-repeat-bind-x-foo.html" rel="import">
<script src="../polymer/polymer.js"></script>
</head>
<body>
<polymer-element name="x-data" attributes="values">
<script>
Polymer('x-data', {
values: ['a', 'b', 'c']
});
</script>
</polymer-element>
<polymer-element name="x-content">
<template>
x-content:
<content select=".repeat"></content>
<content></content>
</template>
<script>
Polymer('x-content');
</script>
</polymer-element>
<polymer-element name="x-repeat" attributes="data data2">
<template>
<x-data id="data"></x-data>
<x-content>
<span class="repeat">// repeat {{d}}</span>
data: {{$.data.values}}<br>
x-foo: <x-foo items="{{$.data.values}}"></x-foo><br>
</x-content>
</template>
<script>
Polymer('x-repeat', {
data: [1, 2, 3],
data2: ['d', 'e', 'f']
});
</script>
</polymer-element>
<x-repeat></x-repeat>
</body>
</html>