ElementRef
class
security
A wrapper around a native element inside of a View.
Security risk
Permitting direct access to the DOM can make your application more vulnerable to XSS attacks. Carefully review any use of ElementRef
in your code. For more detail, see the Security Guide.
class ElementRef<T> { constructor(nativeElement: T) nativeElement: T }
Description
An ElementRef
is backed by a render-specific element. In the browser, this is usually a DOM element.
Constructor
|
nativeElement | T |
Properties
Property | Description |
---|---|
nativeElement: T | The underlying native element or 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 Relying on direct DOM access creates tight coupling between your application and rendering layers which will make it impossible to separate the two and deploy your application into a web worker. |
© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v8.angular.io/api/core/ElementRef