Writable Signals
Introduction
Section titled “Introduction”Writable signals hold mutable state. They provide getter and setter APIs for reading and updating values.
Example
Section titled “Example”const count = signal(0);
console.log(count()); // Read: 0count.set(5); // Set new valuecount.update(c => c + 1); // Update based on current
// With objectsconst user = signal({ name: 'Alice', age: 30 });user.set({ name: 'Bob', age: 31 }); // New referenceSummary
Section titled “Summary”Writable signals are the foundation of Angular’s reactive state model.”