My source code can be access by the following URL:
https://stackblitz.com/edit/angular-aidmpq?file=src%2Fapp%2Fapp.component.html
I want to ask the following coding:
<mat-error *ngIf="logRecipients.errors.required">
Appreciation Log Recipients is <strong>required</strong>
</mat-error>
<mat-error *ngIf="logRecipients.errors.logRecipientValidator">
Invalid email address
</mat-error>
Why the "logRecipients.errors.required" report the following error?
Cannot read property 'required' of null
Why the "logRecipients.errors.logRecipientValidator" prompt the following error?
Cannot read property 'logRecipientValidator' of null
I want to get the built-in "required" validator result to decide whether the "Appreciation Log Recipients is required" message is shown.
I want to get my custom validator result to decide whether the "Invalid email address" message is shown. In case, the validation failed, my validator would return an object {email:true}, how can I read this attribute?