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

ng.getRootComponents

检索与 DOM 元素,指令或组件实例关联的所有根组件。根组件是由 Angular 引导启动的组件。

Retrieves all root components associated with a DOM element, directive or component instance. Root components are those which have been bootstrapped by Angular.

      
      ng.getRootComponents(elementOrDir: {} | Element): {}[]
    
参数
elementOrDir {} | Element

要检索其根组件的 DOM 元素、组件或指令实例。

DOM element, component or directive instance for which to retrieve the root components.

返回值

与目标对象关联的根组件。

{}[]: Root components associated with the target object.