ember-computed-indirect
ember-computed-indirect copied to clipboard
Ember 2.8 support
Hi,
I am hitting a strange behaviour in Ember 2.8. It seems that the get direction works just fine, but the set is not propagated. Is it possible something changed with relation to the data down / events up direction Ember has?
Thanks.
Nevermind, it seems to be caused by something else I missed.
Ok, I tested this again with better debugging and a component like this:
export default Ember.Component.extend({
actions: {
saveEdit: function () {
this.set('show', this.get('value'));
console.log("Edit save: ", this.get('value'), " -> ", this.get('field'), " = ", this.get(this.get('field')), ' = ', this.get('show'));
this.get('content').save();
this.set('editing', false);
}
},
content: undefined,
field: undefined,
show: Ember.computed.indirect('field')
value: null # linked to the edit field, starting the edit copies show -> value
Used like this:
{{#click-to-editarea content=model field='content.summary'}}
Prints out:
Edit save: test 12 -> content.summary = test = test 12
So it seems the indirect proxy itself knows about the change, but the underlying variable is not updated.
Would you mind testing the same case, but hard-coding content.summary
as the value for field
instead of passing it to the component in the template? It's been a long time since I've worked with this, but my gut says it's some sort of weirdness with observers and initializers and whatnot.