recursion - Recursive Observer Dependencies? -


my model tree structure position of child object relative parent.

basically, looks this:

var node = ember.object.extend({   parent: null,   location: null,   absolutelocation: ember.computed('location', 'parent', 'parent.absolutelocation', function() {     var parent = this.get('parent');     if(parent) {       return this.get('location') + parent.get('absolutelocation');     } else {       return this.get('location');     }   }) }); 

the parent property instance of node class.

in theory, should recursively update children's absolutelocation when parent's location updated. however, not i'm seeing. right in app have location , absolutelocation of -39 main node, location of -116 child , absolute location of -56 same child. doesn't add up.

could there's bug in ember somewhere, or on wrong track in finding issue?

note have simplified above example, in reality ember data object , location two-dimensional object. also, absolutelocation property defined in mixin or using reopen (tried both). hope didn't “fix” removing details.

this on ember 1.13.2.

it turned out ember issue. got better after updating 2.0, still isn't fixed.

i ended not using property dependencies work around this, instead triggering refresh manually.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -