I am working on a login form and if the user enters invalid credentials we want to mark both the email and password fields as invalid and display a message that says the log
in component:
formData.form.controls['email'].setErrors({'incorrect': true});
and in HTML:
{{email.errors| json}}