MCPcopy Create free account
hub / github.com/angular/angular / loadComponentRenderer

Function loadComponentRenderer

packages/core/src/render3/instructions/shared.ts:708–723  ·  view source on GitHub ↗
(
  currentDef: DirectiveDef<any> | null,
  tNode: TNode,
  lView: LView,
)

Source from the content-addressed store, hash-verified

706 * instead of the current renderer (see the componentSyntheticHost* instructions).
707 */
708export function loadComponentRenderer(
709 currentDef: DirectiveDef<any> | null,
710 tNode: TNode,
711 lView: LView,
712): Renderer {
713 // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root
714 // component (see packages/core/src/render3/component.ts). This is not consistent with the process
715 // of creating inner components, when current directive index is available in the state. In order
716 // to avoid relying on current def being `null` (thus special-casing root component creation), the
717 // process of creating root component should be unified with the process of creating inner
718 // components.
719 if (currentDef === null || isComponentDef(currentDef)) {
720 lView = unwrapLView(lView[tNode.index])!;
721 }
722 return lView[RENDERER];
723}
724
725/** Handles an error thrown in an LView. */
726export function handleUncaughtError(lView: LView, error: any): void {

Callers 2

Calls 2

isComponentDefFunction · 0.90
unwrapLViewFunction · 0.90

Tested by

no test coverage detected