(lView: LView, deferBlocks: DeferBlockDetails[])
| 28 | * @param deferBlocks defer block aggregator array |
| 29 | */ |
| 30 | export 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…