[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/core/ElementRef [Back]  [Original]

ElementRef Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/core

ElementRef

Class
stable

A wrapper around a native element inside of a View.

Using DOM APIs

On this page

    arrow_upward_alt Back to the top

    API

        
          class ElementRef<T = any> {  constructor(nativeElement: T);  nativeElement: T;}
        
        

    constructor

    ElementRef<T>
    @paramnativeElementT
    @returnsElementRef<T>

    nativeElement

    T
    Use with caution

    Use this API as the last resort when direct access to DOM is needed. Use templating and data-binding provided by Angular instead. If used, it is recommended in combination with DomSanitizer for maxiumum security;

    Description

    A wrapper around a native element inside of a View.

    An ElementRef is backed by a render-specific element. In the browser, this is usually a DOM element.

    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page