Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@polymer/iron-meta
Advanced tools
##<iron-meta>
iron-meta
is a generic element you can use for sharing information across the DOM tree.
It uses monostate pattern 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:
<iron-meta key="info" value="foo/bar"></iron-meta>
Note that value="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.
meta.byKey('info');
Pure imperative form would be like:
document.createElement('iron-meta').byKey('info');
Or, in a Polymer element, you can include a meta in your template:
<iron-meta id="meta"></iron-meta>
...
this.$.meta.byKey('info');
##<iron-meta-query>
iron-meta
is a generic element you can use for sharing information across the DOM tree.
It uses monostate pattern 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:
<iron-meta key="info" value="foo/bar"></iron-meta>
Note that value="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.
meta.byKey('info');
Pure imperative form would be like:
document.createElement('iron-meta').byKey('info');
Or, in a Polymer element, you can include a meta in your template:
<iron-meta id="meta"></iron-meta>
...
this.$.meta.byKey('info');
FAQs
Useful for sharing information across a DOM tree
The npm package @polymer/iron-meta receives a total of 31,804 weekly downloads. As such, @polymer/iron-meta popularity was classified as popular.
We found that @polymer/iron-meta demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.