# Angular: NG0600: Writing to signals is not allowed in a computed or an effect by default

**Code:** `NG0600` · **Category:** Angular · **Seen on:** Angular, TypeScript

A `computed()` (or, by default, an `effect()`) tried to call `.set()` or `.update()` on a signal — that creates hidden update loops.

## Meaning

`computed` must be a pure derivation. Effects used to forbid signal writes unless `allowSignalWrites: true` (since Angular 19 writes in effects are allowed). Move the write to an event handler, derive the value with `computed` instead, or use `linkedSignal` / `toObservable` where appropriate.

## Common causes

- Calling `.set()` / `.update()` inside `computed(() => ...)`
- Writing to a signal inside an `effect()` without `allowSignalWrites` (Angular 16–18)
- Template function that writes to a signal during render
- Using effects to sync two signals that should be derived

## Quick fix

1. Make the value a `computed` instead of writing to a signal
2. Do writes in event handlers or `untracked(() => ...)`
3. Use `linkedSignal` for state derived from another signal that can also be set

## Detailed fix by platform

### Angular

1. `total = computed(() => this.price() * this.qty());` instead of an effect that sets `total`
2. If unavoidable (Angular 16–18): `effect(() => {...}, { allowSignalWrites: true })`

## Code examples

### Derive, do not write

```typescript
price = signal(10);
qty = signal(2);
total = computed(() => this.price() * this.qty());     // pure

// not allowed:
// total = computed(() => { this.log.set('x'); return 1; });   // NG0600
```

## How to diagnose

1. **Context** — computed, effect or template?
2. **Purpose** — Can it be derived instead?
3. **Version** — Angular version (effect rules changed in 19)?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/angular/ng0600-writing-to-signals-in-computed)
