Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

ComponentFactoryResolver

A simple registry that maps Components to generated ComponentFactory classes that can be used to create instances of components. Use to obtain the factory for a given component type, then use the factory's create() method to create a component of that type.

See more...

Deprecated: Angular no longer requires Component factories. Please use other APIs where Component class can be used directly.

      
      abstract class ComponentFactoryResolver {
  static NULL: ComponentFactoryResolver
abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T> }

Description

Note: since v13, dynamic component creation via ViewContainerRef.createComponent does not require resolving component factory: component class can be used directly.

Static properties

Property Description
static NULL: ComponentFactoryResolver

Methods

Retrieves the factory object that creates a component of the given type.

      
      abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>
    
Parameters
component Type<T>

The component type.

Returns

ComponentFactory<T>