Help Angular by taking a 1 minute survey!Go to surveyHome

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>
}
    

Properties

Property Description
abstract selector: string Read-only.

The component's HTML selector.

abstract componentType: Type<any> Read-only.

The component's type

abstract ngContentSelectors: string[] Read-only.

Selector for all elements in the component.

abstract inputs: { propName: string; templateName: string; }[] Read-only.

The inputs of the component.

abstract outputs: { propName: string; templateName: string; }[] Read-only.

The outputs of the component.

Methods

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>
    
Parameters
injector Injector
projectableNodes any[][]

Optional. Default is undefined.

rootSelectorOrNode any

Optional. Default is undefined.

ngModule NgModuleRef

Optional. Default is undefined.

Returns

ComponentRef<C>