-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot access content (childNodes) in nested Polymer Element #414
Comments
This is expected. The 'ready' method cannot be used with code that depends Instead you should use the 'attached' method for this type of thing. When Here's an example: http://jsbin.com/oGECArO/1/edit (removed the textNodes On Tue, Feb 4, 2014 at 8:28 AM, Tomek Wytrębowicz
|
Thanks a lot @sorvell. Is this also the reason why |
We have |
Sure. This is resolved by |
It's best to give the content node an id and use $ to reference it, e.g.:
This allows your content node to be indirected from |
Could you have a look at this please :) |
By sorvell: (Polymer's team member) "[...] The 'ready' method cannot be used with code that depends on the state of external elements, e.g. children or distributed elements or parent. The element is not guaranteed to be in the dom when ready is called. Instead, ready is the signal that the element's internal state is ready for use, its shadowRoot, event listeners, property observers, and bindings. Instead you should use the 'attached' method for this type of thing. When attached is called, the element is in the dom tree. Further, it's best to go asynchronous when accessing external dom. This ensures any element upgrades have been processed. This way you are independent of upgrade ordering. [...]" more info: Polymer/polymer#414
I try to nest one component into another, and access content (light DOM) given to outer element one in inner one.
seems to render fine.
However, I cannot get
<p>Nested content</p>
asx-foo
content:Full example is here: http://jsfiddle.net/tomalec/T7k3C/2/
Is this a bug, or I should access it some other way?
The text was updated successfully, but these errors were encountered: