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

Makes attribute arguments passed to a component two way binding #508

Merged
merged 1 commit into from Oct 21, 2013

Conversation

Projects
None yet
2 participants
@justinbmeyer
Contributor

justinbmeyer commented Oct 21, 2013

If you have a "master" component with a scope value like:

scope: {
  visible: true
}

Pass that property to a low-level compute like:

<low-level showing='visible'></low-level>

If low-level has code like

this.attr('showing', true)

it should change the parent scope's visible property.

justinbmeyer added a commit that referenced this pull request Oct 21, 2013

Merge pull request #508 from bitovi/computes-two-way-binding-passed-a…
…rguments

Makes attribute arguments passed to a component two way binding

@justinbmeyer justinbmeyer merged commit 4832936 into master Oct 21, 2013

1 check passed

default The Travis CI build passed
Details
@whitecolor

This comment has been minimized.

Show comment
Hide comment
@whitecolor

whitecolor Nov 4, 2013

Contributor

Justin, your test passes only because parent and child components have the same name for the attribute

<my-toggler visible="visible">

if you replace "visible" attr in child for example with "shown", something like:

<my-toggler shown="visible">

two way binding won't work as it will try to change "shown" attribute in parent, not "visible".

Here is fiddle
http://jsfiddle.net/xKc3H/249/

Contributor

whitecolor commented Nov 4, 2013

Justin, your test passes only because parent and child components have the same name for the attribute

<my-toggler visible="visible">

if you replace "visible" attr in child for example with "shown", something like:

<my-toggler shown="visible">

two way binding won't work as it will try to change "shown" attribute in parent, not "visible".

Here is fiddle
http://jsfiddle.net/xKc3H/249/

@whitecolor

This comment has been minimized.

Show comment
Hide comment
@whitecolor

whitecolor Nov 4, 2013

Contributor

End there is another problem with two way binding if you try to bind "complex" properties:

<my-toggler shown="visibility.visible">

propertyDataFromScope.parent for "visibility.visible" is not parent scope, but visibility map.

Contributor

whitecolor commented Nov 4, 2013

End there is another problem with two way binding if you try to bind "complex" properties:

<my-toggler shown="visibility.visible">

propertyDataFromScope.parent for "visibility.visible" is not parent scope, but visibility map.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Nov 4, 2013

Contributor

A fiddle would not show this breaking because this is fixed for 2.0.1. Have you tried it with that code?

Contributor

justinbmeyer commented Nov 4, 2013

A fiddle would not show this breaking because this is fixed for 2.0.1. Have you tried it with that code?

@whitecolor

This comment has been minimized.

Show comment
Hide comment
@whitecolor

whitecolor Nov 4, 2013

Contributor

Yes I tried it in my project, I updated can.js yesterday from master. I had to change some code to fix this behaviour. Where there any fixes for this?

Contributor

whitecolor commented Nov 4, 2013

Yes I tried it in my project, I updated can.js yesterday from master. I had to change some code to fix this behaviour. Where there any fixes for this?

@whitecolor

This comment has been minimized.

Show comment
Hide comment
@whitecolor

whitecolor Nov 9, 2013

Contributor

Would you confirm that this doesn't work? If yes, it is quite severe, issue should be opened and fixed for 2.0.1, I think.

Contributor

whitecolor commented Nov 9, 2013

Would you confirm that this doesn't work? If yes, it is quite severe, issue should be opened and fixed for 2.0.1, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment