ComponentFactory

      
      abstract class ComponentFactory<C> {
  abstract selector: string
  abstract componentType: Type<any>
  abstract ngContentSelectors: string[]
  abstract inputs: {...}
  abstract outputs: {...}
  abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: any, ngModule?: NgModuleRef<any>): ComponentRef<C>
}
    

属性

属性说明
abstract selector: string 只读

The component's HTML selector.

abstract componentType: Type<any> 只读

The component's type

abstract ngContentSelectors: string[] 只读

Selector for allelements in the component.

abstract inputs: { propName: string; templateName: string; }[] 只读

The inputs of the component.

abstract outputs: { propName: string; templateName: string; }[] 只读

The outputs of the component.

方法

Creates a new component.

abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: any, ngModule?: NgModuleRef<any>): ComponentRef<C>
      
      abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: any, ngModule?: NgModuleRef<any>): ComponentRef<C>
    
参数
injector Injector
projectableNodes any[][]

可选. 默认值是 undefined.

rootSelectorOrNode any

可选. 默认值是 undefined.

ngModule NgModuleRef

可选. 默认值是 undefined.

返回值

ComponentRef<C>