| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
| This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt |
| The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt |
| Code distributed by Google as part of the polymer project is also |
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt |
| --> |
| <html> |
| <head> |
| <title>core-meta</title> |
| |
| <script src="../webcomponentsjs/webcomponents.js"></script> |
| <link rel="import" href="core-meta.html"> |
| </head> |
| |
| <body> |
| |
| <core-meta id="x-foo" label="foo"></core-meta> |
| <core-meta id="x-bar" label="bar"></core-meta> |
| <core-meta id="x-zot" label="zot"></core-meta> |
| |
| <core-meta id="apple" label="apple" type="fruit"></core-meta> |
| <core-meta id="orange" label="orange" type="fruit"></core-meta> |
| <core-meta id="grape" label="grape" type="fruit"></core-meta> |
| |
| <h2>meta-data</h2> |
| |
| <template id="default" repeat="{{metadata}}"> |
| <div>{{label}}</div> |
| </template> |
| |
| <h2>meta-data (type: fruit)</h2> |
| |
| <template id="fruit" repeat="{{metadata}}"> |
| <div>{{label}}</div> |
| </template> |
| |
| <script> |
| |
| document.addEventListener('polymer-ready', function() { |
| var meta = document.createElement('core-meta'); |
| document.querySelector('template#default').model = { |
| metadata: meta.list |
| }; |
| |
| var fruitMeta = document.createElement('core-meta'); |
| fruitMeta.type = 'fruit'; |
| document.querySelector('template#fruit').model = { |
| metadata: fruitMeta.list |
| }; |
| }); |
| |
| </script> |
| |
| </body> |
| </html> |