-
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
unable to access dom-if content by id #3170
Comments
https://www.polymer-project.org/1.0/docs/devguide/local-dom.html#node-finding
Edit: So what should work is |
@JeremybellEU, this.$$("#myspan") is also undefined |
is the |
condition is a function:
and in the ready function I already have defined ''a'' and ''b'' values. not sure if this is what you was asking... |
did you verify that your |
emm.. no, how to verify that? |
The template helpers ( https://www.polymer-project.org/1.0/docs/devguide/templates.html#dom-change This is a little confusing (and could be clarified better in the docs), but the For more discussion on this, see this doc bug: |
@arthurevans, that is helpfulll. one question though: |
DOM changes are async. One way around this is to wait for the |
For those who encounter same difficulties :
works for me. |
@ebidel |
@marko911 you need to use # when querying by id, like this: |
|
"This.$" works if you call super.ready() before accessing the DOM element in ready(). |
In a custom element I want to access a span and append a child to it but all usual accessors give undefined:
Interesting that outside ready function (after a bit of time when all components are loaded) I can access it in a console via document.getElementById("myspan")... but I need a place in a code to append a child.
How to access a span in this case?
related: http://stackoverflow.com/questions/34138718/how-to-access-content-of-dom-if-inside-a-custom-element
The text was updated successfully, but these errors were encountered: