1
0
Fork 0

Update common client packages

This commit is contained in:
Chocobozzz 2023-05-23 09:00:58 +02:00
parent d4d0f3ba0e
commit 41cde76bbf
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 1856 additions and 1251 deletions

View File

@ -140,7 +140,7 @@
"webpack-cli": "^5.0.1", "webpack-cli": "^5.0.1",
"webtorrent": "1.8.26", "webtorrent": "1.8.26",
"whatwg-fetch": "^3.0.0", "whatwg-fetch": "^3.0.0",
"zone.js": "~0.12.0" "zone.js": "~0.13.0"
}, },
"dependencies": {} "dependencies": {}
} }

View File

@ -1,7 +1,7 @@
import { import {
ApplicationRef, ApplicationRef,
ComponentFactoryResolver,
ComponentRef, ComponentRef,
createComponent,
EmbeddedViewRef, EmbeddedViewRef,
Injectable, Injectable,
Injector, Injector,
@ -16,15 +16,17 @@ export class DynamicElementService {
constructor ( constructor (
private injector: Injector, private injector: Injector,
private applicationRef: ApplicationRef, private applicationRef: ApplicationRef
private componentFactoryResolver: ComponentFactoryResolver
) { } ) { }
createElement <T> (ofComponent: Type<T>) { createElement <T> (ofComponent: Type<T>) {
const div = document.createElement('div') const div = document.createElement('div')
const component = this.componentFactoryResolver.resolveComponentFactory(ofComponent) const component = createComponent(ofComponent, {
.create(this.injector, [], div) environmentInjector: this.applicationRef.injector,
elementInjector: this.injector,
hostElement: div
})
return component return component
} }

File diff suppressed because it is too large Load Diff