Closed
Description
the following example, here:
https://material.angular.io/components/input/overview
located under Custom Error Matcher contains one too many right brackets
and on top of that, is unclear:
function myErrorStateMatcher(control: FormControl, form: FormGroupDirective | NgForm): boolean {
// Error when invalid control is dirty, touched, or submitted
const isSubmitted = form && form.submitted;
return !!(control.invalid && (control.dirty || control.touched || isSubmitted)));
}
why not just use:
return control.invalid && (control.dirty || control.touched || isSubmitted);
?
Metadata
Metadata
Assignees
Labels
No labels