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