diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-23 09:00:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-05-23 09:42:10 +0200 |
commit | 41cde76bbf5ac16a90b5f158672523069db74009 (patch) | |
tree | c740a1e551f26030668309f8e927a6592ce7cada /client/src/app/shared/shared-custom-markup | |
parent | d4d0f3ba0e3577e2725f2e7e7e004478ce30a371 (diff) | |
download | PeerTube-41cde76bbf5ac16a90b5f158672523069db74009.tar.gz PeerTube-41cde76bbf5ac16a90b5f158672523069db74009.tar.zst PeerTube-41cde76bbf5ac16a90b5f158672523069db74009.zip |
Update common client packages
Diffstat (limited to 'client/src/app/shared/shared-custom-markup')
-rw-r--r-- | client/src/app/shared/shared-custom-markup/dynamic-element.service.ts | 12 |
1 files changed, 7 insertions, 5 deletions
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 @@ | |||
1 | import { | 1 | import { |
2 | ApplicationRef, | 2 | ApplicationRef, |
3 | ComponentFactoryResolver, | ||
4 | ComponentRef, | 3 | ComponentRef, |
4 | createComponent, | ||
5 | EmbeddedViewRef, | 5 | EmbeddedViewRef, |
6 | Injectable, | 6 | Injectable, |
7 | Injector, | 7 | Injector, |
@@ -16,15 +16,17 @@ export class DynamicElementService { | |||
16 | 16 | ||
17 | constructor ( | 17 | constructor ( |
18 | private injector: Injector, | 18 | private injector: Injector, |
19 | private applicationRef: ApplicationRef, | 19 | private applicationRef: ApplicationRef |
20 | private componentFactoryResolver: ComponentFactoryResolver | ||
21 | ) { } | 20 | ) { } |
22 | 21 | ||
23 | createElement <T> (ofComponent: Type<T>) { | 22 | createElement <T> (ofComponent: Type<T>) { |
24 | const div = document.createElement('div') | 23 | const div = document.createElement('div') |
25 | 24 | ||
26 | const component = this.componentFactoryResolver.resolveComponentFactory(ofComponent) | 25 | const component = createComponent(ofComponent, { |
27 | .create(this.injector, [], div) | 26 | environmentInjector: this.applicationRef.injector, |
27 | elementInjector: this.injector, | ||
28 | hostElement: div | ||
29 | }) | ||
28 | 30 | ||
29 | return component | 31 | return component |
30 | } | 32 | } |