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

Function getDeferBlocks

packages/core/src/defer/discovery.ts:30–64  ·  view source on GitHub ↗
(lView: LView, deferBlocks: DeferBlockDetails[])

Source from the content-addressed store, hash-verified

28 * @param deferBlocks defer block aggregator array
29 */
30export function getDeferBlocks(lView: LView, deferBlocks: DeferBlockDetails[]) {
31 const tView = lView[TVIEW];
32 for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
33 if (isLContainer(lView[i])) {
34 const lContainer = lView[i];
35 // An LContainer may represent an instance of a defer block, in which case
36 // we store it as a result. Otherwise, keep iterating over LContainer views and
37 // look for defer blocks.
38 const isLast = i === tView.bindingStartIndex - 1;
39 if (!isLast) {
40 const tNode = tView.data[i] as TNode;
41 const tDetails = getTDeferBlockDetails(tView, tNode);
42 if (isTDeferBlockDetails(tDetails)) {
43 deferBlocks.push({lContainer, lView, tNode, tDetails});
44 // This LContainer represents a defer block, so we exit
45 // this iteration and don't inspect views in this LContainer.
46 continue;
47 }
48 }
49
50 // The host can be an `LView` if this is the container
51 // for a component that injects `ViewContainerRef`.
52 if (isLView(lContainer[HOST])) {
53 getDeferBlocks(lContainer[HOST], deferBlocks);
54 }
55
56 for (let j = CONTAINER_HEADER_OFFSET; j < lContainer.length; j++) {
57 getDeferBlocks(lContainer[j] as LView, deferBlocks);
58 }
59 } else if (isLView(lView[i])) {
60 // This is a component, enter the `getDeferBlocks` recursively.
61 getDeferBlocks(lView[i], deferBlocks);
62 }
63 }
64}

Callers

nothing calls this directly

Calls 5

isLContainerFunction · 0.90
getTDeferBlockDetailsFunction · 0.90
isTDeferBlockDetailsFunction · 0.90
isLViewFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…