Title: forms: validator directives (required, minlength, …) are not applied to a custom control bound with ngModel / formControl · Issue #70721 · angular/angular · GitHub
Open Graph Title: forms: validator directives (required, minlength, …) are not applied to a custom control bound with ngModel / formControl · Issue #70721 · angular/angular
X Title: forms: validator directives (required, minlength, …) are not applied to a custom control bound with ngModel / formControl · Issue #70721 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description A component with no ControlValueAccessor and a value (or checked) model is bound through NgModel / FormControlDirective via the custom-cont...
Open Graph Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description A component with no ControlValueAccessor and a value (or checked) model is bound through NgModel / ...
X Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description A component with no ControlValueAccessor and a value (or checked) model is bound through NgModel / ...
Opengraph URL: https://github.com/angular/angular/issues/70721
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"forms: validator directives (required, minlength, …) are not applied to a custom control bound with ngModel / formControl","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\nA component with no ControlValueAccessor and a `value` (or `checked`) model is bound through NgModel /\nFormControlDirective via the custom-control path. Value sync works in both directions, but template validator\ndirectives on that element are never attached: `required`, `minlength`, `maxlength`, `pattern`, `email`, `min`\nand `max` produce no errors and the control stays valid. The same attributes on a native \u003cinput> work. Nothing\nthrows or warns, so a form migrated from a CVA-based control silently starts submitting invalid data.\n\nIn @angular/forms 22.1.6 (fesm2022/forms.mjs):\n- setUpControlValueAccessor (1880) calls setUpValidators (1885).\n- NgModel._setUpStandalone / _setupWithForm (3518–3536) call setupCustomControl() instead when\n isCustomControlBased, and setupCustomControl (2147) never calls setUpValidators.\n- ngControlCreate (2171–2192) does find the RequiredValidator (requiredValidatorViaDi), but only uses it for the\n `required` binding, not as a validator.\nOnly validators set on the FormControl itself (e.g. Validators.required) take effect.\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/jj6trr42?file=src%2Fapp%2Fapp.ts\n\n### Please provide the exception or error you saw\n\n```true\nNone. Expected `custom` and `formControl` to report {\"required\":true}, like `native`.\nActual: custom: null · native: {\"required\":true} · formControl: null\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\n@angular/core 22.1.6, @angular/forms 22.1.6, Node 24.16.0\n```\n\n### Anything else?\n\nWorkaround: set the validators on the FormControl (Validators.required) instead of as template directives.","author":{"url":"https://github.com/thekhegay","@type":"Person","name":"thekhegay"},"datePublished":"2026-09-14T16:24:38Z","url":"https://github.com/angular/angular/issues/70721"}
| 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:70e9710a-b49a-3b7e-35dc-85bcdf319068 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB2C:1D86C4:38F770E:486D3E2:6B01F5C4 |
| html-safe-nonce | aec80d88ea2ac05d559c0f596dc892939a2c866d1b24baf6e53faf289ce696be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjJDOjFEODZDNDozOEY3NzBFOjQ4NkQzRTI6NkIwMUY1QzQiLCJ2aXNpdG9yX2lkIjoiNDU2NDg0MzM1NDU0NTg0NTcwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 171a423342a0d820d4a7b0defbb5ef0c7f5f2c8b89ae41f74e6eeff8cf046226 |
| hovercard-subject-tag | issue:5451902395 |
| 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/70721/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3b75afe3ffe90f13a90b67333674ba1ac7d881b0bbb0e07f0cd5c345c35520d0/angular/angular/issues/70721 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3b75afe3ffe90f13a90b67333674ba1ac7d881b0bbb0e07f0cd5c345c35520d0/angular/angular/issues/70721 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description A component with no ControlValueAccessor and a value (or checked) model is bound through NgModel / ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | thekhegay |
| 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