Toni Mora Toni Mora - 4 months ago 16
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

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.