aurelia / http-client

A simple, restful, message-based wrapper around XMLHttpRequest.
MIT License
62 stars 59 forks source link

lost functionality after aurelia update (Shadow DOM changes?) #126

Closed BrightShadow closed 8 years ago

BrightShadow commented 8 years ago

Hi all. Today I've updated the aurelia packages to the newest version. I've lost some of functionalities in a system which is written in Aurelia.

Currently I've found only one problem: I have a templates creator where I can add some UI elements to create a questionnaire. The flow was simple got to creator and add some stuff. It handled also edition o exisiting templates. There is meny custom-elements inside ans some custom attributes. The logic and HTML is quite complicated. After update the functionality is not working at all. Nothing is displayed inside the creator - I have there a if.bind logic where I decide what to show.

I noticed that the code in HTML don't "see" a parent scope inside its scope any more. I used it to call methods on parent scope or to get properties. I know it was bad, but it was quick&dirty solution.

Is it something with Shadow DOM?

EisenbergEffect commented 8 years ago

It's nothing to do with shadow dom. It has to do with Aurelia Components. Aurelia's components are encapsulated which means they cannot see the binding context from outside of the component. There was a regression in encapsulation that temporarily made it possible to see that outside scope. That bug has been fixed to property encapsulate components. To solve your problem, create bindable properties on your components and pass in the data from the outer context. This will make things more explicit in your architecture.