I'm trying to implement a bridge pattern for content projection. In the component that has the ng-content
tag in the HTML, I tried to get it via this line, where BUTTON_ENABLED_DIALOG
is an InjectionToken
:
@ContentChild(BUTTON_ENABLED_DIALOG, {static: true}) content?: IButtonEnabledDialog
The calling component does add BUTTON_ENABLED_DIALOG
to the providers array.
That value is never getting set, even though I see the content. A tiny StackBlitz example can be found at https://stackblitz.com/edit/angular-ivy-pgnuny?file=src/app/app.component.ts