Last active
June 8, 2022 22:09
-
-
Save bobbyg603/109bb44b15fbae9c63f3a8fad993a51d to your computer and use it in GitHub Desktop.
How to Build a Strongly Typed Angular 14 Super Form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FormControl, FormGroup } from "@angular/forms"; | |
export type ControlsOf<T extends Record<string, any>> = { | |
[K in keyof T]: T[K] extends Record<any, any> | |
? FormGroup<ControlsOf<T[K]>> | |
: FormControl<T[K]>; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment