-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed as not planned
Closed as not planned
Copy link
Labels
Milestone
Description
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
No
Description
I'm not sure if it's a bug or if it's a feature, but the required and minLength validators don't work the same way in classisc forms and in signal forms when the field is an empty array (thus making the transition from classic forms to signal forms a bit harder).
In signal forms, an empty array passes the required validation, but fails the minLength(1) validation.
In "classic" forms, an empty array fails the required validation, but passes the minLength(1) validation.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-mnv1huar?file=src%2Fmain.ts
Please provide the exception or error you saw
NA
Please provide the environment you discovered this bug in (run ng version)
Angular CLI : 21.0.0
Angular : 21.0.0
Node.js : 20.19.1
Package Manager : npm 10.8.2
Operating System : linux x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.0.0 │ ^21.0.0 │
│ @angular/cli │ 21.0.0 │ ^21.0.0 │
│ @angular/common │ 21.0.0 │ ^21.0.0 │
│ @angular/compiler │ 21.0.0 │ ^21.0.0 │
│ @angular/compiler-cli │ 21.0.0 │ ^21.0.0 │
│ @angular/core │ 21.0.0 │ ^21.0.0 │
│ @angular/forms │ 21.0.0 │ ^21.0.0 │
│ @angular/platform-browser │ 21.0.0 │ ^21.0.0 │
│ @angular/router │ 21.0.0 │ ^21.0.0 │
│ rxjs │ 7.8.2 │ ^7.8.1 │
│ typescript │ 5.9.3 │ ^5.9.3 │
│ zone.js │ 0.15.0 │ ~0.15.0 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else?
No response
Reactions are currently unavailable