From da1a20096b4dbce2661bd2c6d5b4736c4a9f0f2f Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Mon, 6 Feb 2023 10:15:24 +0100 Subject: [PATCH] 98855: Remove temp themed ng-content container This is problematic when ng-content is provided but it's not used --- src/app/shared/theme-support/themed.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index 973a3a26f6..d75568e0ba 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -91,11 +91,10 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges ).subscribe((constructor: GenericConstructor) => { const factory = this.resolver.resolveComponentFactory(constructor); - const contentNodes = [[...this.themedElementContent.nativeElement.children].map(node => node)] || undefined; - - this.compRef = this.vcr.createComponent(factory, undefined, undefined, contentNodes); + this.compRef = this.vcr.createComponent(factory, undefined, undefined, [this.themedElementContent.nativeElement.children]); this.connectInputsAndOutputs(); this.cdr.markForCheck(); + this.themedElementContent.nativeElement.remove(); }); }