-
Notifications
You must be signed in to change notification settings - Fork 319
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
2 way data binding not working #14
Comments
This is the expected behaviour since you aren't using Polymer's templating system with lit-element, you are using lit-html's, which doesn't support 2-way binding for performance reasons. |
thank you that's good to know. I was expecting '[[ ]]' to work because this element is part of PolymerLabs. However, since polymer 3 is completely written in JS it's a much better approach to use listeners :) |
I tried the approach with the event listener but it seems to not be able to keep the right scope. Which means, the
|
|
Just bind it either before or when you attach it. "this" is supposed to be the element on which the event is fired... so paper-toggle-button, so if you don't want that, rebind it. You could also do it in the constructor
|
Wonderful. Thanks you. I thought I need to you |
For completion. Here is the working element
|
@BrandiATMuhkuh I believe |
But what if I want to use The problem is that |
What about something like Polymer's |
@FluorescentHallucinogen this is the new reality, where no upward data flow is supposed to be always kept in mind. Still the Web Component should produce events, but I guess it would make sense to make the |
@web-padawan Could you please explain what's wrong with two-way data binding (upward data flow)? Two-way data binding was (is) my favorite feature of Polymer. What are the advantages of unidirectional data flow? |
I've found https://github.com/DiiLord/lit-element and it has @justinfagnani @DiiLord What about to port it to this element? |
Welcome to 2018, everyone is writing his own |
lit-html-brackets also looks very interesting. |
HTML Template Instantiation proposal also adopts mustache syntax as standardized template language. |
I'm expecting 2 way data binding to work similar to polymer templates but I can't get it to work.
For example using a
<paper-toggle-button checked="${toggled}">
only works in one direction (reading, but not writing).I have also tried
<paper-toggle-button checked="[[${toggled}]]">
and<paper-toggle-button checked="[[toggled]]">
The text was updated successfully, but these errors were encountered: