MCPcopy Index your code
hub / github.com/angular/angular / loadComponentRenderer

Function loadComponentRenderer

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

Source from the content-addressed store, hash-verified

687 * instead of the current renderer (see the componentSyntheticHost* instructions).
688 */
689export function loadComponentRenderer(
690 currentDef: DirectiveDef<any> | null,
691 tNode: TNode,
692 lView: LView,
693): Renderer {
694 // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root
695 // component (see packages/core/src/render3/component.ts). This is not consistent with the process
696 // of creating inner components, when current directive index is available in the state. In order
697 // to avoid relying on current def being `null` (thus special-casing root component creation), the
698 // process of creating root component should be unified with the process of creating inner
699 // components.
700 if (currentDef === null || isComponentDef(currentDef)) {
701 lView = unwrapLView(lView[tNode.index])!;
702 }
703 return lView[RENDERER];
704}
705
706/** Handles an error thrown in an LView. */
707export function handleUncaughtError(lView: LView, error: any): void {

Callers 2

Calls 2

isComponentDefFunction · 0.90
unwrapLViewFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…