0Pricing
Angular Academy · Lesson

Computed Signals

Derive values that update automatically.

What is a Computed Signal

A computed() signal derives a value from one or more other signals. Whenever a source signal changes, the computed value is recalculated lazily — only when something reads it.

Computed signals are read-only: you cannot call .set() on them.

Creating a computed

You pass a function to computed(). Angular automatically tracks every signal you read inside it.

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

const price = signal(100);
const quantity = signal(2);

const total = computed(() => price() * quantity());

console.log(total()); // 200

All lessons in this course

  1. Computed Signals
  2. Effects and Side Effects
  3. Effect Cleanup and Lifecycle
  4. linkedSignal and Advanced Patterns
← Back to Angular Academy