-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Updating bound properties in a component's init hook does not notify parent view #11967
Comments
seems related #11637 |
@tehmaestro just a guess but maybe this has something to do with the plan to move toward -> data (bindings) down, actions up methodology. So the setting of the component value for |
@tehmaestro perhaps this would be a better implementation example for the data (bindings) down and actions up methodology: http://emberjs.jsbin.com/paqepi/3/edit?html,js,console,output I get that it works in 1.12 and not in 1.13 I have a lot of that happening to me as well. We're slowly updating our code following the deprecation suggestions (we could not make the update to 1.13.x for our apps). Perhaps it's worth updating your implementation that depended on the observer then update to 1.13 |
I'm experiencing the same issue. I have simple re-pro for the bug here: https://ember-twiddle.com/3273626ee3e8850a9494?openFiles=my-component.component.js%2Capplication.template.hbs As you can see it works for 1.12 and then from 1.13 on the init will not keep controller and component property synched. As a workaround, you can force the bounded property init on your init function: this.set('boundProp', 'foo');
this.attrs.boundProp.update(this.get('boundProp')); |
@tehmaestro @bugant Since 1.13 was supported for a long time, much longer than anticipated; and since we now have an LTS (2.4.5) release… It's very unlikely any patches will be added to 1.13.x That said there are a couple workarounds to this issue, so closing for now. If you have any difficultly with alternative implementations perhaps reach out in the embercommunity.slack.com #-help channel. |
Even I am facing the same issue. Any update on this? |
@dhawalbhanushali, please take a look at this comment: #13823 (comment) |
Hi, so what is the best workaround for this. Cause, as I understand it, In which hook can I update a bound property inside a component? Thanks. |
If I change a bound property, the observer is not triggered for the parentView.
Here, the bound
property
in the controller is not being updated when the component updates it. I tried to use other component hooks, and it only worked indidInsertElement
Here's some examples
Ember 1.12 outputs "changed" : http://emberjs.jsbin.com/bimerijuko/1/edit?html,js,console,output
Ember 1.13 does not : http://emberjs.jsbin.com/qoxumi/1/edit?html,js,console,output
The text was updated successfully, but these errors were encountered: