Toni Mora Toni Mora - 1 year ago 59
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.