Friday, 14 October 2022

Angular - Validate Required Element Value

Use the following code to check the value of the required element.  


<div *ngIf="fname.touched && fname.invalid" class="alert">
            <p *ngIf="fname.errors?.['required']">FirstName is mandatory</p>
            <p *ngIf="fname.invalid">Invalid First Name</p>
        </div>




No comments:

Post a Comment

Oracle - OCI - Exadata Database

Exadata Database is a scalable, private database server that is completely isolated from other tenants. It can be used to run all database ...