Skip to content

Instantly share code, notes, and snippets.

@jsdevtom
Created April 4, 2024 15:06
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 jsdevtom/dc7fc20d36b27dd27da0c27ce9f4b8c9 to your computer and use it in GitHub Desktop.
Save jsdevtom/dc7fc20d36b27dd27da0c27ce9f4b8c9 to your computer and use it in GitHub Desktop.
Angular Debug Form Control
// @ts-ignore
class DebugFormControl<T> extends FormControl<T> {
// @ts-ignore
override get pristine(): boolean {
return this._pristine;
}
override set pristine(value: boolean) {
this._pristine = value;
}
private _pristine: boolean = true;
override markAsTouched(opts?: { onlySelf?: boolean }) {
super.markAsTouched(opts);
}
override markAsDirty(opts?: { onlySelf?: boolean }) {
super.markAsDirty(opts);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment