1<!doctype html> 2<!-- 3@license 4Copyright (c) 2015 The Polymer Project Authors. All rights reserved. 5This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 6The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 7The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 8Code distributed by Google as part of the polymer project is also 9subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 10--> 11<html> 12<head> 13 14 <meta charset="utf-8"> 15 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 16 17 <title>iron-meta</title> 18 19 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> 20 <link rel="import" href="../../paper-styles/demo-pages.html"> 21 <link rel="import" href="../iron-meta.html"> 22</head> 23<body> 24 25 <div class="vertical-section centered"> 26 <h1><iron-meta></h1> 27 <h2>Key Query</h2> 28 29 <iron-meta key="info" value="foo/bar"></iron-meta> 30 31 The <code>value</code> stored at <code>key="info"</code> is <code><meta-test></meta-test></code>. 32 </div> 33 34 <div class="vertical-section centered"> 35 <h2>Type Query</h2> 36 37 <iron-meta type="type1" key="a" value="Polymer"></iron-meta> 38 <iron-meta type="type1" key="b" value="is"></iron-meta> 39 <iron-meta type="type2" key="a" value="wonderful"></iron-meta> 40 <iron-meta type="type2" key="b" value="<3"></iron-meta> 41 42 The <code>value(s)</code> stored at <code>type="type1"</code> are:<br><code><type-one></type-one></code>.<br><br>The <code>value(s)</code> stored at <code>type="type2"</code> are:<br><code><type-two></type-two></code>. 43 </div> 44 45 <script> 46 document.addEventListener('WebComponentsReady', function() { 47 Polymer({ 48 is: 'meta-test', 49 ready: function() { 50 this.textContent = new Polymer.IronMetaQuery({key: 'info'}).value; 51 } 52 }); 53 }); 54 55 Polymer({ 56 is: 'type-one', 57 58 ready: function() { 59 var resultList = new Polymer.IronMetaQuery({type: "type1"}).list; 60 this.textContent = JSON.stringify(resultList); 61 } 62 }); 63 64 Polymer({ 65 is: 'type-two', 66 67 ready: function() { 68 var resultList = new Polymer.IronMetaQuery({type: "type2"}).list; 69 this.textContent = JSON.stringify(resultList); 70 } 71 }); 72 73 </script> 74 75</body> 76</html> 77