ComponentFactory

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

属性

属性名类型说明
selector只读
componentType只读
ngContentSelectors只读

selector for allelements in the component.

inputs只读

the inputs of the component.

outputs只读

the outputs of the component.

方法

Creates a new component.

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

参数

injector

Type: Injector.

projectableNodes

Type: any[][].

可选. 默认值是 undefined.

rootSelectorOrNode

Type: string | any.

可选. 默认值是 undefined.

ngModule

Type: NgModuleRef.

可选. 默认值是 undefined.

返回值

ComponentRef<C>