ANSWERED BELOW
I have a problem with an Aurelia bindingcontext being replaced by the parent component.
I have a first component which has a sourceItem property which is bound in its view:
${sourceItem.Name}
This shows the correct value "Parent name"..
This component has a router-view in which another component is created. I can see this child component being created without problem. The problem is that this child component also has a sourceItem property which is bound in its view in the same way.
${sourceItem.Name}
This SHOULD show the value "Child name" but although I can see this second sourceItem being correctly created, the view displays the value of the parent binding context : "Parent name"
If I change the name of one of the sourceItem (to sourceItem1 for instance), everything works fine. Any idea if I did some mistake or if there is a bug hanging somewhere?
Thanks a lot!
EDIT FOR MORE INFO I noticed that, when navigating to the child route, the problem occurs to me. But when I entered the full URL in the browser's bar and load the page, the binding works correctly. When I check the bindingContext & overrideContext (in the bind() method), the results are exactly the same. So it looks like it could be a timing issue...