Edit: This question was usually called “Getting a parent through DI when the parent is the same type in Aurelia”, but because my elements are nested, it makes sense to just bind the parent to the element, so the name has been changed to reflect this.
If I have a custom element, Thing
, which has a child Thing
(which has another child Thing
, etc.), how can I insert a parent instance when the class is the same?
export class Thing { static inject = [Thing];
As an added complication, the Thing
root element will not have a parent element, so the DI should include an additional injection.
source share