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

broken livebinding after replace can.Map property or remove property #525

Closed
pYr0x opened this Issue Nov 2, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@pYr0x

pYr0x commented Nov 2, 2013

hi,

i have some interesting behaviour that brokes down the livebinding with mustache and can.Map

i have a simple template with deep properties

here is me {{test.firstname}} {{test.lastname}}

if i have that javascript, that livebinding brokes

foobar = new can.Map();

var obj = {
'firstname': 'hans',
'lastname': 'peter'
};

foobar.attr('test',obj);

this will shows the right.. but after a second time and an other object replace the "test" there is no livebinding anymore

var obj = {
'firstname': 'michael',
'lastname': 'grau'
};

foobar.attr('test',obj);

same procedure if i want to remove "test" with deep properties

foobar.removeAttr('test');

@ghost ghost assigned justinbmeyer Nov 2, 2013

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Nov 2, 2013

Contributor

Thanks! I'm going to work on fixing this for 2.0.1. In the short term, if you do:

here is me {{#test}}{{firstname}} {{lastname}}{{/test}}

it will work

Contributor

justinbmeyer commented Nov 2, 2013

Thanks! I'm going to work on fixing this for 2.0.1. In the short term, if you do:

here is me {{#test}}{{firstname}} {{lastname}}{{/test}}

it will work

@pYr0x

This comment has been minimized.

Show comment
Hide comment
@pYr0x

pYr0x Nov 2, 2013

Any idea when 2.0.1 will be Release?

pYr0x commented Nov 2, 2013

Any idea when 2.0.1 will be Release?

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment

justinbmeyer added a commit that referenced this issue Nov 6, 2013

@imjoshdean imjoshdean closed this in #532 Nov 7, 2013

@colinexl

This comment has been minimized.

Show comment
Hide comment
@colinexl

colinexl Jan 2, 2014

I know this issue has been closed, but after the changes in this commit, our compute no longer works the way it did.

Here's a fiddle: http://jsfiddle.net/qYdwR/1180/

Before, we initialized an empty compute by using

can.compute()

Then after some async operations are done, it'll update the compute by calling

can.compute(new ConstructOfSomeSort())

This would then cause the Mustache view to update itself due to live-binding. However, after this commit, the Mustache doesn't update itself anymore. I dug around briefly and it looks like the "computed" function in compute.js is no longer being called after the can compute update.

I believe this issue is happening in the latest CanJS2 as well.

colinexl commented Jan 2, 2014

I know this issue has been closed, but after the changes in this commit, our compute no longer works the way it did.

Here's a fiddle: http://jsfiddle.net/qYdwR/1180/

Before, we initialized an empty compute by using

can.compute()

Then after some async operations are done, it'll update the compute by calling

can.compute(new ConstructOfSomeSort())

This would then cause the Mustache view to update itself due to live-binding. However, after this commit, the Mustache doesn't update itself anymore. I dug around briefly and it looks like the "computed" function in compute.js is no longer being called after the can compute update.

I believe this issue is happening in the latest CanJS2 as well.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Jan 2, 2014

Contributor

If you believe this is a bug, please open a new issue and reference this commit.

Contributor

justinbmeyer commented Jan 2, 2014

If you believe this is a bug, please open a new issue and reference this commit.

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