Update bindings with progressive enhancement


#1

Hi,
I am using progressive enhancement to integrate react components into Aurelia as described here. I.e. I have an Aurelia app that renders some react components and these components have in turn custom content that is implemented with Aurelia via progressive enhancement. I am passing through a binding context from the outer Aurelia app to the progressively enhanced children. This works fine for the initial page load but when I try to update the binding context from the outer Aurelia app, no change events are triggered for the bindings in the progressively enhanced child views.

To solve this I tried to store the View objects retrieved by progressive enhancement and call unbind() and bind() on them because I thought this causes the view to update but it did not help. I attached @changed handlers to the @bindable fields in the child view - they are not triggered. However, when I inspect the binding values in my manual invocation of bind(), I see that the @bindable fields contain the updated values. It’s just that the rendered view does not reflect the changes.

I want to avoid the use of signal bindings though this might work.

Any ideas?


#2

Are you doing something like this:

aurelia.enhance(new MyRootClass(), document.body)

If not, can you show some example code so it gets clearer what you are trying to achieve?