From 73aa164f0f8f7a0e5ba0d41b64efcbd28472818f Mon Sep 17 00:00:00 2001 From: Jens Vannerum Date: Mon, 5 Dec 2022 09:07:54 +0100 Subject: [PATCH] Add missing import --- src/app/shared/theme-support/themed.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index 87f182a5ff..2a85dae402 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -11,7 +11,7 @@ import { OnChanges } from '@angular/core'; import { hasValue, isNotEmpty } from '../empty.util'; -import { from as fromPromise, Observable, of as observableOf, Subscription } from 'rxjs'; +import { from as fromPromise, Observable, of as observableOf, Subscription, BehaviorSubject } from 'rxjs'; import { ThemeService } from './theme.service'; import { catchError, switchMap, map } from 'rxjs/operators'; import { GenericConstructor } from '../../core/shared/generic-constructor'; @@ -25,6 +25,12 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges @ViewChild('vcr', { read: ViewContainerRef }) vcr: ViewContainerRef; protected compRef: ComponentRef; + /** + * A reference to the themed component. Will start as undefined and emit every time the themed + * component is rendered + */ + public compRef$: BehaviorSubject> = new BehaviorSubject(undefined); + protected lazyLoadSub: Subscription; protected themeSub: Subscription; @@ -90,6 +96,7 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges const factory = this.resolver.resolveComponentFactory(constructor); this.compRef = this.vcr.createComponent(factory); this.connectInputsAndOutputs(); + this.compRef$.next(this.compRef); this.cdr.markForCheck(); }); }