Closed lbustelo closed 7 years ago
Good point @lbustelo, thanks! I'll try to make it in some spare time. In meantime I've updated README to match current implementation.
Hopefully it could benefit in performance with Polymer 1.x, the question is how it applies to Polymer 2.0 Template binding.
It seems, that there is a bug, which make this one required to work, as $=
does not work for template
element (https://github.com/Polymer/polymer/issues/4060).
The main problem is that, we need a new name - we cannot override native .content
property of the HTMLTemplateElement
@warpech, @miyconst, @lbustelo, @deadlyfingers any ideas?
I'd like to keep it short, meaningful and similar/related to content
and href
as they match conceptually similar thing.
(work in progress is available at issues/18-content-property
branch)
My proposition for the new name is href
usually, that's what it is - hyperlink with reference to document to fetch template from,
but..
WIP: https://github.com/Juicy/juicy-html/compare/issues/18-href-attr?expand=1
@warpech Maybe we should do it otherwise. Instead of facing dilemma whether to have attribute name that matches inline content and hyper link, and maintain hidden heuristic rules that guesses that you want to load external content. Just make it explicitly separated?
href
content
- and don't code it just forward attribute to use native template.content
property, just control the (auto)stamping via stamp
attribute - https://github.com/Juicy/juicy-html/issues/10)
b. html
which works as before, but no longer collide with property
The above was agreed between me and @tomalec on Hangouts.
@lbustelo Sorry, that it took that long.
Starting from https://github.com/Juicy/juicy-html/releases/tag/2.0.0 you can use attributes and properties: href
for URLs and html
for inline content. So you no longer have to remember about $=
Would be nice if
content
could be set using property binding in adom-bind
template. Right now it requires$=
. At the very least, the README needs to reflect that requirement.