Course lesson
Update an Angular Signal's Value and Make Computed Signal Emit Updates
Signal values can be updated using the set or update methods. When updating signal values, it's crucial to follow immutable practices.
- Duration
- 8 min
- Access
- Free
- Transcript
- Retained from source evidence
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
setmethod for updating primitive values like strings or numbers - Use the
updatemethod 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.