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

Function toStringExpression

packages/compiler/test/render3/view/util.ts:121–143  ·  view source on GitHub ↗
(expr: e.AST)

Source from the content-addressed store, hash-verified

119}
120
121export function toStringExpression(expr: e.AST): string {
122 while (expr instanceof e.ASTWithSource) {
123 expr = expr.ast;
124 }
125 if (expr instanceof e.PropertyRead) {
126 if (expr.receiver instanceof e.ImplicitReceiver || expr.receiver instanceof e.ThisReceiver) {
127 return expr.name;
128 } else {
129 return `${toStringExpression(expr.receiver)}.${expr.name}`;
130 }
131 } else if (expr instanceof e.ImplicitReceiver) {
132 return '';
133 } else if (expr instanceof e.Interpolation) {
134 let str = '{{';
135 for (let i = 0; i < expr.expressions.length; i++) {
136 str += expr.strings[i] + toStringExpression(expr.expressions[i]);
137 }
138 str += expr.strings[expr.strings.length - 1] + '}}';
139 return str;
140 } else {
141 throw new Error(`Unsupported type: ${(expr as any).constructor.name}`);
142 }
143}
144
145// Parse an html string to IVY specific info
146export function parseR3(

Callers 1

findExpressionInNodeFunction · 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…