Signals in Templates
Bind signal values directly in component templates.
Signals in Templates
One of the best parts of signals: you read them directly in templates by calling them, just like in TypeScript. No async pipe is required.
Reading in Interpolation
In the template, call the signal inside the double-brace interpolation to display its value.
@Component({
selector: 'app-counter',
template: '<p>Count: {{ count() }}</p>'
})
export class CounterComponent {
count = signal(0);
}All lessons in this course
- What Are Signals
- Creating and Reading Signals
- Updating Signals with set and update
- Signals in Templates