Toni Mora Toni Mora - 2 months ago 8x
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


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.