Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 835 Bytes

File metadata and controls

34 lines (22 loc) · 835 Bytes

@name Signals must be invoked in template interpolations.

@description

Angular Signals are zero-argument functions (() => T). When executed, they return the current value of the signal. This means they are meant to be invoked when used in template interpolations to render its value.

What should I do instead?

When you use a signal within a template interpolation, you need to invoke it to render its value.

import {Component, signal, Signal} from '@angular/core';

@Component({ // … }) class MyComponent { mySignal: Signal = signal(0) }

<div>{{ mySignal() }}/div>

@reviewed 2023-04-02