Cara Mengatur Pesan Kesalahan Kustom ke Formulir Dalam 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