-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Milestone
Description
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
Yes
Description
Using a signal inside a CVA to store the edited value throws NG0600 if the CVA is used with a Field.
This can be easily reproduced by updating the interop.spec.ts in the Angular repo to use a value signal, and run bazel test //packages/forms/signals/test/web:test_chromium
or in the Stackblitz below
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-anhs8wzj?file=src%2Fmain.ts
Please provide the exception or error you saw
Error: NG0600: Writing to signals is not allowed while Angular renders the template (eg. interpolations)
at packages/core/src/application/application_ref.ts:86:10
at throwInvalidWriteToSignalError (packages/core/primitives/signals/src/errors.ts:18:2)
at signalSetFn (packages/core/primitives/signals/src/signal.ts:88:4)
at getter.set (packages/core/primitives/signals/src/signal.ts:70:31)
at CustomControl.writeValue (packages/forms/signals/test/web/interop.spec.ts:41:17)
at Field.ɵinteropControlUpdate (packages/forms/signals/src/api/field_directive.ts:98:25)
at ɵɵcontrol (packages/core/src/render3/instructions/control.ts:89:14)
at TestCmp_Template2 (packages/forms/signals/test/web/interop.spec.ts:121:33)
at executeTemplate (packages/core/src/render3/instructions/shared.ts:109:4)
at refreshView (packages/core/src/render3/instructions/change_detection.ts:232:6)
Please provide the environment you discovered this bug in (run ng version)
Angular CLI : 21.0.0-next.8
Angular : 21.0.0-next.9
Node.js : 20.19.1
Package Manager : npm 10.8.2
Operating System : linux x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/animations │ 21.0.0-next.9 │ 21.0.0-next.9 │
│ @angular/build │ 21.0.0-next.8 │ 21.0.0-next.8 │
│ @angular/cli │ 21.0.0-next.8 │ 21.0.0-next.8 │
│ @angular/common │ 21.0.0-next.9 │ 21.0.0-next.9 │
│ @angular/compiler │ 21.0.0-next.9 │ 21.0.0-next.9 │
│ @angular/compiler-cli │ 21.0.0-next.9 │ 21.0.0-next.9 │
│ @angular/core │ 21.0.0-next.9 │ 21.0.0-next.9 │
│ @angular/forms │ 21.0.0-next.9 │ 21.0.0-next.9 │
│ @angular/platform-browser │ 21.0.0-next.9 │ 21.0.0-next.9 │
│ @angular/router │ 21.0.0-next.9 │ 21.0.0-next.9 │
│ rxjs │ 7.8.2 │ ^7.8.1 │
│ typescript │ 5.9.3 │ ^5.8.2 │
│ zone.js │ 0.15.0 │ ~0.15.0 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else?
No response