Created
November 28, 2020 21:59
-
-
Save alexlondon07/3403b09d2180f661349330b7356edc09 to your computer and use it in GitHub Desktop.
How to find the invalid controls in angular 4 reactive 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
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