set form invalid angular code example Example: set form invalid angular myForm.setErrors({ 'invalid': true });