Given the following setup where app-parent is used in app:
parent.component.html (selector: app-parent)
<div class="parent">
<app-some-logic>
<ng-content></ng-content>
</app-some-logic>
</div>
app.component.html
<app-parent>
<app-child></app-child>
</app-parent>
When creating the child class as follows, the injected parent (AppSomeLogic) will not be found.
@Component({
selector: 'app-child',
standalone: true,
imports: [],
...
})
export class AppChild {
constructor(parent: AppSomeLogic) {
super(parent);
}
}
Is it possible to inject AppSomeLogic into AppChild (when AppChild is injected into the ng-content inside AppSomeLogic in AppParent template)?