This is the archived documentation for Angular v5. Please visit angular.io to see documentation for the current version of Angular.

ComponentFactory

npm Package @angular/core
Module import { ComponentFactory } from '@angular/core';
Source core/src/linker/component_factory.ts

Overview

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

Members

      
      get selector: string
    

      
      get componentType: Type<any>
    

      
      get ngContentSelectors: string[]
    

selector for all elements in the component.


      
      get inputs: {
    propName: string;
    templateName: string;
}[]
    

the inputs of the component.


      
      get outputs: {
    propName: string;
    templateName: string;
}[]
    

the outputs of the component.


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

Creates a new component.