ComponentFactory取得DOM节点

来源:互联网 发布:托业网络课程 编辑:程序博客网 时间:2024/05/22 12:32

取得DOM节点:
ComponentFactoryResolver.resolveComponentFactory.create.location.nativeElement

class ComponentFactoryResolver {  static NULL: ComponentFactoryResolver  resolveComponentFactory<T>(component: Type<T>):ComponentFactory<T>}
class ComponentFactory<C> {  get selector(): string  get componentType(): Type<any>  get ngContentSelectors(): string[]  get inputs(): {propName: string, templateName: string}[]  get outputs(): {propName: string, templateName: string}[]  create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any, ngModule?: NgModuleRef<any>): ComponentRef<C>}
class ComponentRef<C> {  get location(): ElementRef  get injector(): Injector  get instance(): C  get hostView(): ViewRef  get changeDetectorRef(): ChangeDetectorRef  get componentType(): Type<any>  destroy(): void  onDestroy(callback: Function): void}
class ElementRef {  nativeElement: any}