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

Function isTNodeDescendant

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

* Checks if `node` is a descendant of `ancestor` within the SAME view. * * Since we are in the same view, we can safely use `tNode.parent` to determine * if `ancestor` is an ancestor of the current `node`.

(node: TNode, ancestor: TNode)

Source from the content-addressed store, hash-verified

212 * if `ancestor` is an ancestor of the current `node`.
213 */
214function isTNodeDescendant(node: TNode, ancestor: TNode): boolean {
215 let curr: TNode | null = node;
216 while (curr) {
217 if (curr === ancestor) return true;
218 curr = curr.parent;
219 }
220 return false;
221}
222
223/**
224 * Checks if `lView` is a descendant of `parentTNode` in `parentLView` (crossing view boundaries).

Callers 2

walkElementInjectorsFunction · 0.85
isLViewDescendantOfTNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…