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

Unified Diff: third_party/polymer/v0_8/components-chromium/iron-meta/README.md

Issue 1162563004: Upgrade to 1.0 and switch clients to dom-repeat where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a layout import and remove the gzipped webanimation in reproduce.sh Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v0_8/components-chromium/iron-meta/README.md
diff --git a/third_party/polymer/v0_8/components-chromium/iron-meta/README.md b/third_party/polymer/v0_8/components-chromium/iron-meta/README.md
index 819e336beab75053a7f1fd7bae255d520778ccd3..b3b0f273b6bc6ef92a60d31a9c3c5e2f524e36a5 100644
--- a/third_party/polymer/v0_8/components-chromium/iron-meta/README.md
+++ b/third_party/polymer/v0_8/components-chromium/iron-meta/README.md
@@ -1,4 +1,46 @@
iron-meta
=========
-See the [component page](http://polymerelements.github.io/iron-meta) for more information.
+`iron-meta` is a generic element you can use for sharing information across the DOM tree.
+It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any
+instance of iron-meta has access to the shared
+information. You can use `iron-meta` to share whatever you want (or create an extension
+[like x-meta] for enhancements).
+
+The `iron-meta` instances containing your actual data can be loaded in an import,
+or constructed in any way you see fit. The only requirement is that you create them
+before you try to access them.
+
+Examples:
+
+If I create an instance like this:
+
+```html
+<iron-meta key="info" keyUrl="foo/bar"></iron-meta>
+```
+
+Note that keyUrl="foo/bar" is the metadata I've defined. I could define more
+attributes or use child nodes to define additional metadata.
+
+Now I can access that element (and it's metadata) from any iron-meta instance
+via the byKey method, e.g.
+
+```javascript
+meta.byKey('info').getAttribute('keyUrl').
+```
+
+Pure imperative form would be like:
+
+```javascript
+document.createElement('iron-meta').byKey('info').getAttribute('keyUrl');
+```
+
+Or, in a Polymer element, you can include a meta in your template:
+
+```html
+<iron-meta id="meta"></iron-meta>
+```
+
+```javascript
+this.$.meta.byKey('info').getAttribute('keyUrl');
+```

Powered by Google App Engine
This is Rietveld 408576698