Skip to content
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

DomPropertyBindingTarget as default for HTMLElement.bind to enable complex attribute binding #178

Open
nguyenanduong opened this issue Apr 24, 2016 · 3 comments

Comments

@nguyenanduong
Copy link

nguyenanduong commented Apr 24, 2016

Problem:
I am working on a list component which I expect this kind of binding:
<my-list items={{model.items}}></my-list>

That doesn't work out of the box as default HTMLElement.bind uses setAttribute to set the binding value on the target. Any complex value from source will be stringify.

Expect
Liaison should support that kind of binding. Expected behavior is that model.items will be set to the list's items property

Implementation
Use DomPropertyBindingTarget as default binding target instead of DOMBindingTarget

@asudoh
Copy link
Contributor

asudoh commented Apr 24, 2016

@nguyenanduong Do you have a test case?

@nguyenanduong
Copy link
Author

I have pretty complex project setup to post. I will try to make a jsfiddle for it.

@asudoh
Copy link
Contributor

asudoh commented Apr 24, 2016

Cool, also please note that liaison directs HTMLElement.bind() to a delite widget property if it detects the there is a widget property with the given name:

target = isOwned.call(this, widgetProperty) && new WidgetBindingTarget(this, widgetProperty);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants