Skip to content

Instantly share code, notes, and snippets.

@alexlondon07
Created November 28, 2020 21:59
Show Gist options
  • Save alexlondon07/3403b09d2180f661349330b7356edc09 to your computer and use it in GitHub Desktop.
Save alexlondon07/3403b09d2180f661349330b7356edc09 to your computer and use it in GitHub Desktop.
How to find the invalid controls in angular 4 reactive form
public findInvalidControls() {
const invalid = [];
const controls = this.AddCustomerForm.controls;
for (const name in controls) {
if (controls[name].invalid) {
invalid.push(name);
}
}
return invalid;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment