OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | |
3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
6 Code distributed by Google as part of the polymer project is also | |
7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | |
8 --><!-- | |
9 `core-meta` provides a method of constructing a self-organizing database. | |
10 It is useful to collate element meta-data for things like catalogs and for | |
11 designer. | |
12 | |
13 Example, an element folder has a `metadata.html` file in it, that contains a | |
14 `core-meta`, something like this: | |
15 | |
16 <core-meta id="my-element" label="My Element"> | |
17 <property name="color" value="blue"></property> | |
18 </core-meta> | |
19 | |
20 An application can import as many of these files as it wants, and then use | |
21 `core-meta` again to access the collected data. | |
22 | |
23 <script> | |
24 var meta = document.createElement('core-meta'); | |
25 console.log(meta.list); // dump a list of all meta-data elements that have
been created | |
26 </script> | |
27 | |
28 Use `byId(id)` to retrive a specific core-meta. | |
29 | |
30 <script> | |
31 var meta = document.createElement('core-meta'); | |
32 console.log(meta.byId('my-element')); | |
33 </script> | |
34 | |
35 By default all meta-data are stored in a single databse. If your meta-data | |
36 have different types and want them to be stored separately, use `type` to | |
37 differentiate them. | |
38 | |
39 Example: | |
40 | |
41 <core-meta id="x-foo" type="xElt"></core-meta> | |
42 <core-meta id="x-bar" type="xElt"></core-meta> | |
43 <core-meta id="y-bar" type="yElt"></core-meta> | |
44 | |
45 <script> | |
46 var meta = document.createElement('core-meta'); | |
47 meta.type = 'xElt'; | |
48 console.log(meta.list); | |
49 </script> | |
50 | |
51 @group Polymer Core Elements | |
52 @element core-meta | |
53 @homepage github.io | |
54 --><html><head><link rel="import" href="../polymer/polymer.html"> | |
55 | |
56 </head><body><polymer-element name="core-meta" attributes="label type" hidden=""
assetpath=""> | |
57 | |
58 </polymer-element> | |
59 <script charset="utf-8" src="core-meta-extracted.js"></script></body></html> | |
OLD | NEW |