Jak ustawić niestandardowy komunikat o błędzie na formularz w Angular
<span
*ngIf="
!loginForm.get('email')?.valid &&
(loginForm.get('email')?.touched || loginForm.get('email')?.dirty)
"
>
{{
loginForm.get('email')?.hasError('required')
? 'Username Required'
: loginForm.get('email')?.getError('invalid')
}}
</span>
this.loginForm.get('email')?.setErrors({ invalid: 'Invalid Username' });
Manohar Shrestha