Ramco Ramco

Ramco Ramco

  • 435
  • 3.4k
  • 546.9k

Error - Reactive Form Validation

Jun 5 2024 5:52 AM

Hi

  I am getting error - Parse error Missing expected ]

            <mat-form-field appearance="outline">
                <mat-label>First Name</mat-label>
                <input matInput type="text" formControlName="firstName">
                <div class="text-danger" @if="empForm.firstName.invalid && (emoForm.firstName.touched || empForm.firstName.dirty)">
                    <span @if="firstName.errors?.['required'> This is required </span>
                </div>
            </mat-form-field> 

Thanks


Answers (7)