You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Polymer docs are mostly in Markdown with some HTML. [Jekyll][jekyll] is used to
5
5
We use Jekyll 2.0+ and [Grunt][grunt] to generate the documentation, and compass to compile SASS to CSS. You'll need to install the requirements before working on the docs (these instructions assume [NPM is already installed](http://nodejs.org/download/)):
Copy file name to clipboardExpand all lines: docs/polymer/polymer.md
+27-2Lines changed: 27 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -278,7 +278,7 @@ Below is a table of the lifecycle methods according to the Custom Elements
278
278
Spec | {{site.project_title}} | Called when
279
279
|-
280
280
createdCallback | created | An instance of the element is created.
281
-
- | ready | The `<polymer-element>` has been fully prepared (e.g. Shadow DOM created, property observers setup, event listeners attached, etc).
281
+
- | ready | The `<polymer-element>` has been fully prepared (e.g. shadow DOM created, property observers setup, event listeners attached, etc).
282
282
attachedCallback | attached | An instance of the element was inserted into the DOM.
283
283
- | domReady | Called when the element's initial set of children are guaranteed to exist. This is an appropriate time to poke at the element's parent or light DOM children. Another use is when you have sibling custom elements (e.g. they're `.innerHTML`'d together, at the same time). Before element A can use B's API/properties, element B needs to be upgraded. The `domReady` callback ensures both elements exist.
284
284
detachedCallback | detached | An instance was removed from the DOM.
@@ -736,7 +736,14 @@ It's important to note that **{{site.project_title}} does not call the <code><em
736
736
737
737
### Automatic node finding
738
738
739
-
Another useful feature of {{site.project_title}} is node reference marshalling. Every node in a component's shadow DOM that is tagged with an `id` attribute is automatically referenced in the component's `this.$` hash.
739
+
Another useful feature of {{site.project_title}} is automatic node finding.
740
+
Nodes in a component's shadow DOM that are tagged with an
741
+
`id` attribute are automatically referenced in the component's `this.$` hash.
742
+
743
+
**Note:** Nodes created dynamically using data binding are _not_ added to the
744
+
`this.$` hash. The hash includes only _statically_ created shadow DOM nodes
745
+
(that is, the nodes defined in the element's outermost template).
746
+
{: .alert .alert-warning }
740
747
741
748
For example, the following defines a component whose template contains an `<input>` element whose `id` attribute is `nameInput`. The component can refer to that element with the expression `this.$.nameInput`.
742
749
@@ -753,6 +760,24 @@ For example, the following defines a component whose template contains an `<inpu
753
760
</script>
754
761
</polymer-element>
755
762
763
+
To locate other nodes inside the element's shadow DOM, you can create a
764
+
container element with a known ID and use `querySelector` to retrieve
765
+
descendants. For example, if your element's template looks like this:
0 commit comments