@@ -34,8 +34,8 @@ of the samples in an interactive sandbox.
34
34
Tap the buttons following each feature to learn more.
35
35
36
36
** The Plunker samples won't work in Internet Explorer 11.** These code samples need to
37
- be transpiled from ES6 to ES5 to work in Internet Explorer. This is usually done as a
38
- build step. At the moment, we don't have a way to transpile the interactive samples on
37
+ be transpiled from ES6 to ES5 to work in Internet Explorer. This is usually done as a
38
+ build step. At the moment, we don't have a way to transpile the interactive samples on
39
39
Plunker. The samples will work in browsers that support ES6 - for example, the latest
40
40
versions of Chrome, Edge, Firefox and Safari.
41
41
{: .alert .alert-info }
@@ -49,7 +49,7 @@ an element name with a class, so you can add properties and methods to your cust
49
49
element. The custom element's name ** must start with an ASCII letter and
50
50
contain a dash (-)** .
51
51
52
- <demo-tabs selected =" 0 " name =" qt-1-register " src = " http://plnkr.co/edit/FYhDkkAuD4TEnsgeZuc7?p=preview " >
52
+ <demo-tabs selected =" 0 " name =" qt-1-register " editor-open-file = " custom-element.js " project-path = " /3.0/start/samples/custom-element " >
53
53
<paper-tab slot =" tabs " >custom-element.js</paper-tab >
54
54
<div >
55
55
@@ -66,13 +66,12 @@ contain a dash (-)**.
66
66
```
67
67
68
68
</div >
69
- <iframe slot =" results " frameborder =" 0 " src =" samples/custom-element/index.html " width =" 100% " height =" 40 " ></iframe >
70
69
</demo-tabs >
71
70
72
71
Try it out in ** Plunker** :
73
- * Try modifying the contents of ` this.textContent ` .
72
+ * Try modifying the contents of ` this.textContent ` .
74
73
* If you’re familiar with your browser’s developer tools, try printing the
75
- custom element’s ` tagName ` property to the console.
74
+ custom element’s ` tagName ` property to the console.
76
75
Hint: add ` console.log(this.tagName); ` to the constructor method!
77
76
78
77
This sample uses a lifecycle callback
@@ -93,7 +92,7 @@ You can use the `ready` callback for one-time initialization work after the elem
93
92
Many elements include some internal DOM nodes to implement the element's UI and behavior.
94
93
You can use Polymer's DOM templating to create a shadow DOM tree for your element.
95
94
96
- <demo-tabs selected =" 0 " name =" qt-2-shadow-dom " src = " http://plnkr.co/edit/IvBQDkwRlLuG6P1fIMLr?p=preview " >
95
+ <demo-tabs selected =" 0 " name =" qt-2-shadow-dom " editor-open-file = " dom-element.js " project-path = " /3.0/start/samples/dom-element " >
97
96
<paper-tab slot =" tabs " >dom-element.js</paper-tab >
98
97
<div >
99
98
@@ -110,7 +109,6 @@ You can use Polymer's DOM templating to create a shadow DOM tree for your elemen
110
109
```
111
110
112
111
</div >
113
- <iframe slot =" results " frameborder =" 0 " src =" samples/dom-element/index.html " width =" 100% " height =" 40 " ></iframe >
114
112
</demo-tabs >
115
113
116
114
Try it out in ** Plunker** :
@@ -128,7 +126,7 @@ so they render as if they were inserted into the shadow DOM tree.
128
126
This example creates a simple tag that decorates an image by wrapping it
129
127
with a styled ` <div> ` tag.
130
128
131
- <demo-tabs selected =" 0 " name =" qt-3-compose " src = " http://plnkr.co/edit/RhauVxmC96dSKRgSn04Y?p=preview " >
129
+ <demo-tabs selected =" 0 " name =" qt-3-compose " editor-open-file = " picture-frame.js " project-path = " /3.0/start/samples/picture-frame " >
132
130
<paper-tab slot =" tabs " >picture-frame.js</paper-tab >
133
131
<div >
134
132
@@ -145,7 +143,6 @@ with a styled `<div>` tag.
145
143
```
146
144
147
145
</div >
148
- <iframe slot =" results " frameborder =" 0 " src =" samples/picture-frame/index.html " width =" 100% " height =" 60 " ></iframe >
149
146
</demo-tabs >
150
147
151
148
Try it out in ** Plunker** :
@@ -168,7 +165,7 @@ Data binding is a great way to quickly propagate changes in your element and red
168
165
You can bind properties in your component using the "double-mustache" syntax (` {%raw%}{{}}{%endraw%} ` ).
169
166
The ` {%raw%}{{}}{%endraw%} ` is replaced by the value of the property referenced between the brackets.
170
167
171
- <demo-tabs selected =" 0 " name =" qt-4-data-binding " src = " http://plnkr.co/edit/dobBH1EwNvnymIrs0yMd?p=preview " >
168
+ <demo-tabs selected =" 0 " name =" qt-4-data-binding " editor-open-file = " name-tag.js " project-path = " /3.0/start/samples/name-tag " >
172
169
<paper-tab slot =" tabs " >name-tag.js</paper-tab >
173
170
<div >
174
171
@@ -185,14 +182,13 @@ The `{%raw%}{{}}{%endraw%}` is replaced by the value of the property referenced
185
182
```
186
183
187
184
</div >
188
- <iframe slot =" results " frameborder =" 0 " src =" samples/name-tag/index.html " width =" 100% " height =" 40 " ></iframe >
189
185
</demo-tabs >
190
186
191
187
Try it out in ** Plunker** :
192
188
* Try editing the value of the ` owner ` property.
193
- * Try adding another property and binding it in your component.
189
+ * Try adding another property and binding it in your component.
194
190
Hint: Add ` this.propertyName = 'Property contents'; ` to the constructor
195
- and add something like ` <p>{{propertyName}}</p> ` to the element’s template.
191
+ and add something like ` <p>{{propertyName}}</p> ` to the element’s template.
196
192
197
193
<p ><a href =" /3.0/docs/devguide/data-binding " class =" blue-button " >
198
194
Learn more: data binding</a ></p >
@@ -206,7 +202,7 @@ values, configuring properties from markup, observing property changes, and more
206
202
The following example declares the ` owner ` property from the last example.
207
203
It also shows configuring the owner property from markup in ` index.html ` .
208
204
209
- <demo-tabs selected =" 0 " name =" qt-5-declare-property " src = " http://plnkr.co/edit/nnEna7Sp3HoT8ndablOp?p=preview " >
205
+ <demo-tabs selected =" 0 " name =" qt-5-declare-property " editor-open-file = " configurable-name-tag.js " project-path = " /3.0/start/samples/configurable-name-tag " >
210
206
<paper-tab slot =" tabs " >configurable-name-tag.js</paper-tab >
211
207
<div >
212
208
@@ -223,7 +219,6 @@ It also shows configuring the owner property from markup in `index.html`.
223
219
```
224
220
225
221
</div >
226
- <iframe slot =" results " frameborder =" 0 " src =" samples/configurable-name-tag/index.html " width =" 100% " height =" 40 " ></iframe >
227
222
</demo-tabs >
228
223
229
224
Try it out in ** Plunker** :
@@ -239,10 +234,10 @@ In addition to text content, you can bind to an element's _properties_ (using
239
234
can optionally support two-way binding, using curly braces (` property-name="{{binding}}" ` ).
240
235
241
236
This example uses two-way binding: binding the value of a property on a parent element to a property
242
- on the child element. When the child element updates the property, the changes are bound to the
237
+ on the child element. When the child element updates the property, the changes are bound to the
243
238
parent element.
244
239
245
- <demo-tabs selected =" 0 " name =" qt-6-bind-property " src = " http://plnkr.co/edit/ixopefPZUV96R6SzEJun?p=preview " >
240
+ <demo-tabs selected =" 0 " name =" qt-6-bind-property " editor-open-file = " parent-element.js " project-path = " /3.0/start/samples/parent-element " >
246
241
<paper-tab slot =" tabs " >parent-element.js</paper-tab >
247
242
<div >
248
243
@@ -267,21 +262,20 @@ parent element.
267
262
```
268
263
269
264
</div >
270
- <iframe slot =" results " frameborder =" 0 " src =" samples/parent-element/index.html " width =" 100% " height =" 100 " ></iframe >
271
265
</demo-tabs >
272
266
273
267
** Note:** ` <child-element> ` exposes its property to be used in two-way binding by setting the
274
- ` reflectToAttribute ` and ` notify ` attributes when the property is declared.
268
+ ` reflectToAttribute ` and ` notify ` attributes when the property is declared.
275
269
{: .alert .alert-info }
276
270
277
271
<p ><a href =" /3.0/docs/devguide/data-binding#two-way-bindings " class =" blue-button " >
278
272
Learn more: Two-way binding</a ></p >
279
273
280
- <!--
274
+ <!--
281
275
This example uses two-way binding: binding the value of a custom input element (`iron-input`)
282
276
to the element's `owner` property, so it's updated as the user types.
283
277
284
- <demo-tabs selected="0" name="qt-6-bind-property" src="http://plnkr.co/edit/VdazK3ub45MrwYU1GTRM?p=preview ">
278
+ <demo-tabs selected="0" name="qt-6-bind-property" editor-open-file="editable-name-tag.js" project-path="/3.0/start/samples/editable-name-tag" ">
285
279
<paper-tab slot="tabs">editable-name-tag.js</paper-tab>
286
280
<div>
287
281
@@ -298,7 +292,6 @@ to the element's `owner` property, so it's updated as the user types.
298
292
```
299
293
300
294
</div>
301
- <iframe slot="results" frameborder="0" src="samples/editable-name-tag/index.html" width="100%" height="100"></iframe>
302
295
</demo-tabs>
303
296
304
297
Try it out in **Plunker**:
@@ -314,7 +307,7 @@ data binding and input validation.
314
307
315
308
The template repeater (` dom-repeat ` ) is a specialized template that binds to an array. It creates one instance of the template's contents for each item in the array.
316
309
317
- <demo-tabs selected =" 0 " name =" qt-7-dom-repeat " src = " http://plnkr.co/edit/9qFNzWTiytFEqJjRNxNi?p=preview " >
310
+ <demo-tabs selected =" 0 " name =" qt-7-dom-repeat " editor-open-file = " employee-list.js " project-path = " /3.0/start/samples/employee-list " >
318
311
<paper-tab slot =" tabs " >employee-list.js</paper-tab >
319
312
<div >
320
313
@@ -331,16 +324,15 @@ The template repeater (`dom-repeat`) is a specialized template that binds to an
331
324
```
332
325
333
326
</div >
334
- <iframe slot =" results " frameborder =" 0 " src =" samples/employee-list/index.html " width =" 100% " height =" 100 " ></iframe >
335
327
</demo-tabs >
336
328
337
329
Try it out in ** Plunker** :
338
330
* Change the first and last names inside this.employees
339
331
* Add another employee by inserting the following item into the array definition:<br />
340
332
``` js
341
- {first: ' Shawna' , last: ' Williams' }
333
+ {first: ' Shawna' , last: ' Williams' }
342
334
```
343
-
335
+
344
336
Don't forget to make sure your commas are correct!
345
337
346
338
<p ><a href =" /3.0/docs/devguide/templates " class =" blue-button " >
0 commit comments