Update an Angular Signal's Value and Make Computed Signal Emit Updates

InstructorTomasz Ducin

Share this video with your friends

Send Tweet

Signal values can be updated using the set or update methods. When updating signal values, it's crucial to follow immutable practices.

Key points to keep in mind:

  • Use the set method for updating primitive values like strings or numbers
  • Use the update method with a callback that returns a new object or array when updating complex values
  • Avoid mutating signal values directly

Failure to follow immutable practices can result in stale data being displayed in the template.