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.

RendererFactory2

Creates and initializes a custom renderer that implements the Renderer2 base class.

      
      abstract class RendererFactory2 {
abstract createRenderer(hostElement: any, type: RendererType2): Renderer2
abstract begin()?: void
abstract end()?: void
abstract whenRenderingDone()?: Promise<any> }

Methods

Creates and initializes a custom renderer for a host DOM element.

      
      abstract createRenderer(hostElement: any, type: RendererType2): Renderer2
    
Parameters
hostElement any

The element to render.

type RendererType2

The base class to implement.

Returns

Renderer2: The new custom renderer instance.

A callback invoked when rendering has begun.

      
      abstract begin()?: void
    
Parameters

There are no parameters.

Returns

void

A callback invoked when rendering has completed.

      
      abstract end()?: void
    
Parameters

There are no parameters.

Returns

void

Use with animations test-only mode. Notifies the test when rendering has completed.

      
      abstract whenRenderingDone()?: Promise<any>
    
Parameters

There are no parameters.

Returns

Promise<any>: The asynchronous result of the developer-defined function.