ErikHer
ErikHer

Reputation: 247

Can set some type for FormControl value?

Framework which I use (Angular 7).

I want set some type for FormControl like this.

    startDate: FormControl<NgbDate>;
    endDate: FormControl<NgbDate>;

Do you have any experience with it or it is not posible in angular?

Upvotes: 10

Views: 15072

Answers (2)

Naveen kumar
Naveen kumar

Reputation: 41

It is available in angular 14 ,

startDate: FormControl<Date | null>(null);
endDate: FormControl<Date | null>(null);

Upvotes: 1

Shifenis
Shifenis

Reputation: 1125

For now it's not possibile. Check this issue to Angular GitHub Reactive forms are not strongly typed

Upvotes: 8

Related Questions