Passing required length value automatically in angular

Viewed 55

I want to pass the minimum length error message automatically by adding the code bellow, but {{username?.errors?.['minLength'].requiredLength}} doesn't show any number!

and when I put a number instead of {{username?.errors?.['minLength'].requiredLength}} it shown correctly in the error message.

PS: I use angular cli 13

<div *ngIf="username?.errors?.['minlength']">
    **{{ username?.errors?.['minLength'].requiredLength }}** characters At least
</div>
0 Answers
Related