Juicy / juicy-html

A custom element that lets you load HTML partials into your Web page. Declarative way for client-side includes.
http://juicy.github.io/juicy-html/
MIT License
62 stars 12 forks source link

Why is `content` not a property an requires attribute style binding `$=`? #18

Closed lbustelo closed 7 years ago

lbustelo commented 8 years ago

Would be nice if content could be set using property binding in a dom-bind template. Right now it requires $=. At the very least, the README needs to reflect that requirement.

tomalec commented 8 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.

tomalec commented 8 years ago

Hopefully it could benefit in performance with Polymer 1.x, the question is how it applies to Polymer 2.0 Template binding.

tomalec commented 8 years ago

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.

tomalec commented 8 years ago

(work in progress is available at issues/18-content-property branch)

tomalec commented 8 years ago

My proposition for the new name is href

WIP: https://github.com/Juicy/juicy-html/compare/issues/18-href-attr?expand=1

tomalec commented 7 years ago

@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?

warpech commented 7 years ago

The above was agreed between me and @tomalec on Hangouts.

tomalec commented 7 years ago

@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 $=