Title: NG0200: Circular dependency when component implements both ControlValueAccessor and FormValueControl with transformedValue · Issue #68078 · angular/angular · GitHub
Open Graph Title: NG0200: Circular dependency when component implements both ControlValueAccessor and FormValueControl with transformedValue · Issue #68078 · angular/angular
X Title: NG0200: Circular dependency when component implements both ControlValueAccessor and FormValueControl with transformedValue · Issue #68078 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description Using transformedValue from @angular/forms/signals in a component that also provides NG_VALUE_ACCESSOR (to support legacy reactive forms / ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description Using transformedValue from @angular/forms/signals in a component that also provides NG_VALUE_ACCES...
X Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description Using transformedValue from @angular/forms/signals in a component that also provides NG_VALUE_ACCES...
Opengraph URL: https://github.com/angular/angular/issues/68078
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NG0200: Circular dependency when component implements both ControlValueAccessor and FormValueControl with transformedValue","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nforms\n\n### Is this a regression?\n\nNo\n\n### Description\n\nUsing `transformedValue` from @angular/forms/signals in a component that also provides `NG_VALUE_ACCESSOR` (to support legacy reactive forms / ngModel) causes a circular dependency error (NG0200) at runtime when the component is used with the [formField] directive.\n\n**Steps to Reproduce**\n1. Create a component that implements both ControlValueAccessor and FormValueControl\u003cT>\n2. Provide NG_VALUE_ACCESSOR in the component's providers array (needed to support ngModel / formControl usage)\n3. Use transformedValue as a class field to manage display-vs-model value transformation\n4. Use the component in a template with [formField] binding\n\n```\n@Component({\n selector: 'my-input',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MyInputComponent),\n multi: true,\n },\n ],\n})\nexport class MyInputComponent\n implements ControlValueAccessor, FormValueControl\u003cnumber | null>\n{\n public value = model\u003cnumber | null>(null);\n\n // This line causes NG0200 when [formField] is used on this component\n public raw = transformedValue(this.value, {\n format: (v) => v?.toString() ?? null,\n parse: (v) => ({ value: v ? parseFloat(v) : null }),\n });\n\n // ControlValueAccessor methods...\n writeValue(value: number | null) { ... }\n registerOnChange(fn: any) { ... }\n registerOnTouched(fn: any) { ... }\n}\n```\n\n### Please provide a link to a minimal reproduction of the bug\n\n_No response_\n\n### Please provide the exception or error you saw\n\n```true\nNG0200: Circular dependency detected for `MyInputComponent`.\nPath: MyInputComponent -> InjectionToken FORM_FIELD_PARSE_ERRORS -> FormField -> InjectionToken NgValueAccessor -> MyInputComponent.\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular\t21.2.0\n@angular/forms/signals 21.2.0\nNode 25.2.1\n```\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/ddamiankowalski","@type":"Person","name":"ddamiankowalski"},"datePublished":"2026-04-08T10:45:25Z","url":"https://github.com/angular/angular/issues/68078"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cbb85777-266b-d491-10c1-379a204bd2b9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9690:39FDE1:9875BB:BF4A49:6B021A18 |
| html-safe-nonce | 9b2d4372a0cd9521f82ec2472444112400e2024446ba93d83e1f0b020eb7c6cf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjkwOjM5RkRFMTo5ODc1QkI6QkY0QTQ5OjZCMDIxQTE4IiwidmlzaXRvcl9pZCI6IjU2MDYxMzgwMTkxNzk1MzQ4NzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7cc881e769bd9c8f5f69bea32d382c15e4ce4eb2775af9e473a144e39756811e |
| hovercard-subject-tag | issue:4223931864 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/68078/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8986053b475086e41928a09eb09b8b5785ca1856139e4db4910afdf27dadc48d/angular/angular/issues/68078 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8986053b475086e41928a09eb09b8b5785ca1856139e4db4910afdf27dadc48d/angular/angular/issues/68078 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description Using transformedValue from @angular/forms/signals in a component that also provides NG_VALUE_ACCES... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ddamiankowalski |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width