W3cubDocs

/Angular 12

ng.getHostElement

global function

Retrieves the host element of a component or directive instance. The host element is the DOM element that matched the selector of the directive.

ng.getHostElement(componentOrDirective: {}): Element

Parameters
componentOrDirective {}

Component or directive instance for which the host element should be retrieved.

Returns

Element: Host element of the target.

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/api/core/global/ngGetHostElement