From 41cde76bbf5ac16a90b5f158672523069db74009 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 May 2023 09:00:58 +0200 Subject: Update common client packages --- .../shared/shared-custom-markup/dynamic-element.service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'client/src') diff --git a/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts b/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts index e967e30ac..208dba721 100644 --- a/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts +++ b/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts @@ -1,7 +1,7 @@ import { ApplicationRef, - ComponentFactoryResolver, ComponentRef, + createComponent, EmbeddedViewRef, Injectable, Injector, @@ -16,15 +16,17 @@ export class DynamicElementService { constructor ( private injector: Injector, - private applicationRef: ApplicationRef, - private componentFactoryResolver: ComponentFactoryResolver + private applicationRef: ApplicationRef ) { } createElement (ofComponent: Type) { const div = document.createElement('div') - const component = this.componentFactoryResolver.resolveComponentFactory(ofComponent) - .create(this.injector, [], div) + const component = createComponent(ofComponent, { + environmentInjector: this.applicationRef.injector, + elementInjector: this.injector, + hostElement: div + }) return component } -- cgit v1.2.3