Angular Academy · Lesson

Signals in Templates

Bind signal values directly in component templates.

Lesson 4 of 413 steps

Signals in Templates is a free Angular Academy lesson on CoddyKit. This is lesson 4 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the Angular Academy learning path, and your progress syncs across the web and the CoddyKit app. The Angular Academy course includes 4 lessons in total.

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);
}

No Async Pipe Needed

With Observables you needed the async pipe to subscribe and unsubscribe. Signals are synchronous, so you simply call them. There is nothing to unsubscribe.

Automatic View Updates

When a signal read in the template changes, Angular knows that template depends on it and updates just that binding. This is fine-grained reactivity in action.

Calling Signals in Event Handlers

Bind events to component methods that update signals. The template re-renders the affected bindings automatically.

@Component({
  selector: 'app-counter',
  template: '<button (click)="inc()">{{ count() }}</button>'
})
export class CounterComponent {
  count = signal(0);
  inc() { this.count.update(v => v + 1); }
}

Signals in Property Bindings

You can call a signal inside any binding, including property and attribute bindings.

// disabled when count reaches 0
// template: <button [disabled]="count() === 0">Go</button>

Signals with Built-in Control Flow

Modern templates use built-in control flow blocks. You read a signal inside an if block by calling it.

// template:
// @if (count() > 0) {
//   <p>Positive</p>
// }

Computed Signals in Templates

Derived values are great for templates. A computed signal recalculates only when its sources change and is read the same way.

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

export class CartComponent {
  qty = signal(2);
  price = signal(10);
  total = computed(() => this.qty() * this.price());
}

Reading Computed in the View

Read the computed signal in the template just like any signal.

// template: <p>Total: {{ total() }}</p>

Why This Is Efficient

Because Angular tracks exactly which template expressions read which signals, it can skip work for parts of the view that did not depend on the changed signal.

Common Pitfall: Forgetting Parentheses

If you write count instead of count() in a template, you will display the signal function itself, not its value. Always call the signal.

Quick Check: Templates

How do signals appear in templates?

Recap: Signals in Templates

You read signals in templates by calling them with parentheses, with no async pipe and nothing to unsubscribe. Angular updates only the bindings that depend on a changed signal, and computed signals work the same way. You have completed the Signals fundamentals.

Free to start

Learn HTML with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
38
Lessons
144

Frequently Asked Questions

Is the “Signals in Templates” lesson free?

Yes — any 3 lessons of the Angular Academy learning path, including “Signals in Templates”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The Angular Academy course includes 4 lessons in total.

What will I learn in “Signals in Templates”?

Bind signal values directly in component templates. You practise Angular Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Angular Academy?

No prior experience is required. Angular Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 4 of 4.

How long does the “Signals in Templates” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Angular Academy lesson?

Yes. Every Angular Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What Are Signals
  2. Creating and Reading Signals
  3. Updating Signals with set and update
  4. Signals in Templates
← Back to Angular Academy