Skip to content

Instantly share code, notes, and snippets.

@bobbyg603
Last active June 8, 2022 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobbyg603/109bb44b15fbae9c63f3a8fad993a51d to your computer and use it in GitHub Desktop.
Save bobbyg603/109bb44b15fbae9c63f3a8fad993a51d to your computer and use it in GitHub Desktop.
How to Build a Strongly Typed Angular 14 Super Form
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