Toni Mora Toni Mora - 1 year ago 74
Javascript Question

What is the difference between "selectRootElement" and "createViewRoot" in AngularJS 2?

in the "Renderer" section, the official documentation does not specify... "Not Yet Documented" url

Answer Source

selectRootElement selects root element from DOM:

selectRootElement(selector: string): Element {...}

while createViewRoot creates ShadowDOM root at hostElement:

createViewRoot(hostElement: any): any {...}

You can see difference in the source code.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download