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

Function findExpression

packages/compiler/test/render3/view/util.ts:89–104  ·  view source on GitHub ↗
(tmpl: a.Node[], expr: string)

Source from the content-addressed store, hash-verified

87}
88
89export function findExpression(tmpl: a.Node[], expr: string): e.AST | null {
90 const res = tmpl.reduce(
91 (found, node) => {
92 if (found !== null) {
93 return found;
94 } else {
95 return findExpressionInNode(node, expr);
96 }
97 },
98 null as e.AST | null,
99 );
100 if (res instanceof e.ASTWithSource) {
101 return res.ast;
102 }
103 return res;
104}
105
106function findExpressionInNode(node: a.Node, expr: string): e.AST | null {
107 if (node instanceof a.Element || node instanceof a.Template || node instanceof a.Component) {

Callers 2

binding_spec.tsFile · 0.90
findExpressionInNodeFunction · 0.85

Calls 2

findExpressionInNodeFunction · 0.85
reduceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…