mardi 27 février 2018

Component life-cycle

I'm trying to understand the issue in the ember-form-for (https://github.com/martndemus/ember-form-for/blob/master/addon/components/form-field.js#L64) but IMHO the code is not that important, it is just an ordinary component.

The component works perfectly when re-rendering does not occur. In the init() we will do set(this, 'name', 'value') and it works as expected. But after re-rendering, the init() is not called as expected (https://guides.emberjs.com/v3.0.0/components/the-component-lifecycle/), the object has same identifier as before rendering but the value that were set in the init() are lost. And I do not understand why.




Aucun commentaire:

Enregistrer un commentaire