MCPcopy Create free account
hub / github.com/angular/angular / TcbConditionOp

Class TcbConditionOp

packages/compiler/src/typecheck/ops/expression.ts:84–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 * Executing this operation returns nothing.
83 */
84export class TcbConditionOp extends TcbOp {
85 constructor(
86 private tcb: Context,
87 private scope: Scope,
88 private expression: AST,
89 ) {
90 super();
91 }
92
93 override get optional() {
94 return false;
95 }
96
97 override execute(): null {
98 const expr = tcbExpression(this.expression, this.tcb, this.scope);
99 // Wrap in an if-statement to enable TS2774 for uninvoked signals/functions.
100 this.scope.addStatement(new TcbExpr(`if (${expr.print()}) {}`));
101 return null;
102 }
103}
104
105export class TcbExpressionTranslator {
106 constructor(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected