Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Side by Side Diff: third_party/polymer/v1_0/components/iron-meta/README.md

Issue 1269803005: Remove third_party/polymer from .gitignore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 iron-meta
2 =========
3
4 `iron-meta` is a generic element you can use for sharing information across the DOM tree.
5 It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that a ny
6 instance of iron-meta has access to the shared
7 information. You can use `iron-meta` to share whatever you want (or create an ex tension
8 [like x-meta] for enhancements).
9
10 The `iron-meta` instances containing your actual data can be loaded in an import ,
11 or constructed in any way you see fit. The only requirement is that you create t hem
12 before you try to access them.
13
14 Examples:
15
16 If I create an instance like this:
17
18 ```html
19 <iron-meta key="info" value="foo/bar"></iron-meta>
20 ```
21
22 Note that value="foo/bar" is the metadata I've defined. I could define more
23 attributes or use child nodes to define additional metadata.
24
25 Now I can access that element (and it's metadata) from any iron-meta instance
26 via the byKey method, e.g.
27
28 ```javascript
29 meta.byKey('info').getAttribute('value');
30 ```
31
32 Pure imperative form would be like:
33
34 ```javascript
35 document.createElement('iron-meta').byKey('info').getAttribute('value');
36 ```
37
38 Or, in a Polymer element, you can include a meta in your template:
39
40 ```html
41 <iron-meta id="meta"></iron-meta>
42 ```
43
44 ```javascript
45 this.$.meta.byKey('info').getAttribute('value');
46 ```
OLDNEW
« no previous file with comments | « third_party/polymer/v1_0/components/iron-meta/.gitignore ('k') | third_party/polymer/v1_0/components/iron-meta/bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698