MCPcopy
hub / github.com/angular/angular / renderComponent

Function renderComponent

packages/core/src/render3/instructions/render.ts:32–51  ·  view source on GitHub ↗
(hostLView: LView, componentHostIdx: number)

Source from the content-addressed store, hash-verified

30import {executeTemplate} from './shared';
31
32export function renderComponent(hostLView: LView, componentHostIdx: number) {
33 ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
34 const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
35 const componentTView = componentView[TVIEW];
36 syncViewWithBlueprint(componentTView, componentView);
37
38 const hostRNode = componentView[HOST];
39 // Populate an LView with hydration info retrieved from the DOM via TransferState.
40 if (hostRNode !== null && componentView[HYDRATION] === null) {
41 componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR]);
42 }
43
44 profiler(ProfilerEvent.ComponentStart);
45
46 try {
47 renderView(componentTView, componentView, componentView[CONTEXT]);
48 } finally {
49 profiler(ProfilerEvent.ComponentEnd, componentView[CONTEXT] as any as {});
50 }
51}
52
53/**
54 * Syncs an LView instance with its blueprint if they have gotten out of sync.

Callers 1

renderChildComponentsFunction · 0.70

Calls 7

assertEqualFunction · 0.90
isCreationModeFunction · 0.90
getComponentLViewByIndexFunction · 0.90
retrieveHydrationInfoFunction · 0.90
profilerFunction · 0.90
syncViewWithBlueprintFunction · 0.85
renderViewFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…