Closed Hypenate closed 2 years ago
This indeed seems to work:
export type Person = {
id: string,
birthday: FormControl<Date>;
}
const form3 = this.fb.group<Person>({
id: 'id',
birthday: this.fb.control(new Date)
})
But it doesn't feel intuative. I need to update my type to something that doesn't reflect the 'reallity'.
If I update my type to:
export type Person = {
id: string,
birthday: Date | string;
}
Then this becomes valid again:
const form1 = this.fb.group<ControlsOf<Person>>({
id: new FormControl('id'),
birthday: new FormControl(new Date())
})
Which makes a lot more sense, but it's stange that the compiler does not complain about this 🤔
Is this a regression?
No
Description
I'm unable to create a FormGroup with a type that contains a Date.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
Anything else?
No response
Do you want to create a pull request?
No