From 967991004a5d431694c49b7d80f33ae0b5a6b31f Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Mon, 4 May 2026 11:44:31 +0300 Subject: [PATCH] chore(html-container): drop unused ViewContainerRef and stale comments Remove the no-longer-used ViewContainerRef injection and the commented- out fallback branches now that initAngularComponent uses the angularContainer view container exclusively. --- .../widget/lib/html/html-container-widget.component.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.component.ts index 177083b844..f7bae926bc 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.component.ts @@ -24,7 +24,6 @@ import { Optional, Type, ViewChild, - ViewContainerRef, ViewEncapsulation } from '@angular/core'; import { WidgetContext } from '@home/models/widget-component.models'; @@ -91,7 +90,6 @@ export class HtmlContainerWidgetComponent implements OnInit { widgetErrorData: ExceptionData; constructor(private elementRef: ElementRef, - private containerRef: ViewContainerRef, @Optional() @Inject(MODULES_MAP) private modulesMap: IModulesMap, @Inject(SHARED_MODULE_TOKEN) private sharedModule: Type, @Inject(WIDGET_COMPONENTS_MODULE_TOKEN) private widgetComponentsModule: Type, @@ -190,7 +188,6 @@ export class HtmlContainerWidgetComponent implements OnInit { } private initAngularComponent(imports?: Type[], containerFunction?: CompiledTbFunction): void { - //this.containerRef.clear(); this.angularContainer.viewContainerRef.clear(); const destroyContainerInstanceResources = this.destroyContainerInstanceResources.bind(this); const template = this.settings.html || ''; @@ -225,9 +222,9 @@ export class HtmlContainerWidgetComponent implements OnInit { ).subscribe({ next: (componentType) => { this.containerInstanceComponentType = componentType; - const injector: Injector = Injector.create({providers: [], parent: this.angularContainer.viewContainerRef.injector/*this.containerRef.injector*/}); + const injector: Injector = Injector.create({providers: [], parent: this.angularContainer.viewContainerRef.injector}); try { - /*this.containerRef*/this.angularContainer.viewContainerRef.createComponent(this.containerInstanceComponentType, + this.angularContainer.viewContainerRef.createComponent(this.containerInstanceComponentType, {index: 0, injector}); } catch (error) {