-
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
Providing templates via light dom #4573
Comments
We've significantly improved the template system to allow runtime-binding and stamping of templates. Can you try the new API's out and see if they meet your needs? |
Thank you for your response - the new improvements look good and I think that you are on the right track with making basic templating functionality intrinsic to an element. My use case is slightly different. I have an element with a In this specific case I don't need to stamp it , but simply pass it to the dom-depeat, but I totally see how ease of stamping is likely to come in handy as well. Unfortunately I am having difficulty getting the new template from within the element, Here's an example of what I'm trying to do: |
This Stack Overflow answer https://stackoverflow.com/a/44235946/3750066 implements a solution similar to what you are looking for. |
Thanks a lot @aaronanderson - that's pretty much what I was looking for, glad you were able to figure it out. Takes a bit more then a couple of lines of code but at least it's doable. This seems like a common use case, so hopefully they will streamline template handling in future versions. Looks like they've also just been fixing template content cashing in #4597 - something you might have dealt with as well. |
|
Reopening so @kevinpschaaf or someone on the polymer team can answer @aaronanderson question. Please close as you see fit. |
In Polymer 2.0, we're following a convention across the board that non-underscored methods (denoted with So yes, Note there's an issue open on the API doc viewer to update the API filtering checkboxes to reflect this (currently what says "Show Private" is actually hiding/showing protected members): PolymerElements/iron-doc-viewer#117 |
One thing that might be useful for Polymer is an easy way to declare element templates in light dom. In general Templatizer requires substantial amount of additional code and is often an overkill when we just want to tweak the element a bit depending on where or how it's being used.
As you can see some PaperElements are currently trying to define different templates for when they are used with Polymer 1 or 2 and are not relying on Templatizer and instead creating their own boilerplate code to swap templates at run-time and embedding it into the elements.
A more common use case would be declaring element template similar how we declare contents to be distributed into its slot(s):
This is more of a question to explore some possibilities in this regard. Thanks
The text was updated successfully, but these errors were encountered: