填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

ng.getHostElement

检索组件或指令实例的宿主元素。 宿主元素是与指令的选择器匹配的 DOM 元素。

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
    
参数
componentOrDirective {}

要为其检索宿主元素的组件或指令实例。

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

返回值

目标的宿主元素。

Element: Host element of the target.