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

Function isLViewDescendantOfTNode

packages/core/src/debug/ai/di_graph.ts:234–246  ·  view source on GitHub ↗

* Checks if `lView` is a descendant of `parentTNode` in `parentLView` (crossing view boundaries). * * `tNode.parent` is restricted to referring to nodes within the SAME view. When we cross * view boundaries (e.g., entering a component's internal view or an embedded view like `@if`), * `tNode.par

(lView: LView, parentLView: LView, parentTNode: TNode)

Source from the content-addressed store, hash-verified

232 * `parentLView`.
233 */
234function isLViewDescendantOfTNode(lView: LView, parentLView: LView, parentTNode: TNode): boolean {
235 let currentLView: LView | null = lView;
236 let hostTNode: TNode | null = null;
237
238 while (currentLView && currentLView !== parentLView) {
239 hostTNode = currentLView[T_HOST];
240 currentLView = getLViewParent(currentLView);
241 }
242
243 return (
244 currentLView === parentLView && hostTNode !== null && isTNodeDescendant(hostTNode, parentTNode)
245 );
246}
247
248/** Find the parent environment injector of the given injector. */
249function getParentEnvInjector(injector: Injector): Injector | undefined {

Callers 1

walkElementInjectorsFunction · 0.85

Calls 2

getLViewParentFunction · 0.90
isTNodeDescendantFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…