-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
needs triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
If I try to use Datepicker similar to this example from Setting the selected date but with signal forms i get a compile time error:
✘ [ERROR] TS2322: Type 'Date' is not assignable to type 'string'. [plugin angular-compiler]
src/example/datepicker-value-example.html:28:53:
28 │ <input matInput [matDatepicker]="picker4" [field]="form.date">
╵ ~~~~~~~~~
Error occurs in the template of component DatepickerValueExample.
src/example/datepicker-value-example.ts:12:15:
12 │ templateUrl: 'datepicker-value-example.html',
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reproduction
StackBlitz link: https://stackblitz.com/edit/zzkeckx2?file=src%2Fexample%2Fdatepicker-value-example.ts,src%2Fexample%2Fdatepicker-value-example.html&startScript=start
Expected Behavior
No compile time error when using Datepicker with DateAdapter and [field] directive.
Actual Behavior
TS2322: Type 'Date' is not assignable to type 'string'.
Environment
- Angular: 21.0.1
- CDK/Material: 21.0.1
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
Metadata
Metadata
Assignees
Labels
needs triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team