Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

More basics #12

Closed
wants to merge 7 commits into from
Closed

More basics #12

wants to merge 7 commits into from

Conversation

shailen
Copy link
Contributor

@shailen shailen commented Sep 3, 2014

@robdodson @ebidel

Three more recipes:

  • finding-shadow-dom-elements.html
  • binding-to-a-computed-property.html
  • creating-a-one-time-binding.html

@shailen shailen assigned ebidel and robdodson and unassigned ebidel Sep 3, 2014
@shailen
Copy link
Contributor Author

shailen commented Sep 3, 2014

Sorry, it seems that I cannot assign to more than one person. @ebidel, @robdodson, can you review? Thanks.

Shadow DOM provides encapsulation by hiding DOM subtrees under a
shadow root, which can be accessed using the **shadowRoot** property:

this.shadowRoot.querySelector('div');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it is possible do this.shadowRoot.querySelector, I believe it is a discouraged practice. It's possible for someone to subclass your element, and then this.shadowRoot.querySelector would not refer to the correct shadowRoot. The recommendation is to use automatic node finding and give the element you're after an id. See this thread on Github.

@ebidel what are your thoughts on this?

@shailen
Copy link
Contributor Author

shailen commented Sep 3, 2014

@robdodson Patch uploaded. PTAL?

-->

<!--
# Binding to a Computed Property
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Defining computed properties"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing it "Using a Computed Property", which is pretty neutral.

@ebidel
Copy link
Contributor

ebidel commented Sep 3, 2014

Reviewed

@shailen
Copy link
Contributor Author

shailen commented Sep 3, 2014

@ebidel @robdodson Patch addressing comments uploaded. Please review.

@robdodson
Copy link
Contributor

LGTM

@shailen shailen closed this in f565161 Sep 3, 2014
@ebidel ebidel deleted the more_basics branch September 3, 2014 22:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants