• Overview
@angular/core

ElementRef

Class

A wrapper around a native element inside of a View.

  
    class ElementRef<T = any> {}
  
  

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. Alternatively you can take a look at Renderer2 which provides an API that can be safely used.

Jump to details