0Pricing
Angular Academy · Lesson

Updating Signals with set and update

Change signal values reactively.

Changing a Signal

A writable signal can be changed in two ways: set() to replace the value, and update() to derive a new value from the current one.

Using set()

set(newValue) replaces the signal value entirely with the value you pass.

const c = signal(0);
c.set(1);
console.log(c()); // 1

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