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.

RendererType2

Used by RendererFactory2 to associate custom rendering data and styles with a rendering implementation.

      
      interface RendererType2 {
  id: string
  encapsulation: ViewEncapsulation
  styles: string[]
  data: {...}
}
    

Properties

Property Description
id: string

A unique identifying string for the new renderer, used when creating unique styles for encapsulation.

encapsulation: ViewEncapsulation

The view encapsulation type, which determines how styles are applied to DOM elements. One of

  • Emulated (default): Emulate native scoping of styles.
  • Native: Use the native encapsulation mechanism of the renderer.
  • ShadowDom: Use modern Shadow DOM and create a ShadowRoot for component's host element.
  • None: Do not provide any template or style encapsulation.
styles: string[]

Defines CSS styles to be stored on a renderer instance.

data: { [kind: string]: any; }

Defines arbitrary developer-defined data to be stored on a renderer instance. This is useful for renderers that delegate to other renderers.