| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 @license | 2 @license |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --><html><head><link rel="import" href="../polymer/polymer.html"> | 9 --><html><head><link rel="import" href="../polymer/polymer.html"> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 If I create an instance like this: | 24 If I create an instance like this: |
| 25 | 25 |
| 26 <iron-meta key="info" value="foo/bar"></iron-meta> | 26 <iron-meta key="info" value="foo/bar"></iron-meta> |
| 27 | 27 |
| 28 Note that value="foo/bar" is the metadata I've defined. I could define more | 28 Note that value="foo/bar" is the metadata I've defined. I could define more |
| 29 attributes or use child nodes to define additional metadata. | 29 attributes or use child nodes to define additional metadata. |
| 30 | 30 |
| 31 Now I can access that element (and it's metadata) from any iron-meta instance | 31 Now I can access that element (and it's metadata) from any iron-meta instance |
| 32 via the byKey method, e.g. | 32 via the byKey method, e.g. |
| 33 | 33 |
| 34 meta.byKey('info').getAttribute('value'); | 34 meta.byKey('info'); |
| 35 | 35 |
| 36 Pure imperative form would be like: | 36 Pure imperative form would be like: |
| 37 | 37 |
| 38 document.createElement('iron-meta').byKey('info').getAttribute('value'); | 38 document.createElement('iron-meta').byKey('info'); |
| 39 | 39 |
| 40 Or, in a Polymer element, you can include a meta in your template: | 40 Or, in a Polymer element, you can include a meta in your template: |
| 41 | 41 |
| 42 <iron-meta id="meta"></iron-meta> | 42 <iron-meta id="meta"></iron-meta> |
| 43 ... | 43 ... |
| 44 this.$.meta.byKey('info').getAttribute('value'); | 44 this.$.meta.byKey('info'); |
| 45 | 45 |
| 46 @group Iron Elements | 46 @group Iron Elements |
| 47 @demo demo/index.html | 47 @demo demo/index.html |
| 48 @hero hero.svg | 48 @hero hero.svg |
| 49 @element iron-meta | 49 @element iron-meta |
| 50 --> | 50 --> |
| 51 | 51 |
| 52 </head><body><script src="iron-meta-extracted.js"></script></body></html> | 52 </head><body><script src="iron-meta-extracted.js"></script></body></html> |
| OLD | NEW |