<!-- The hasError method will tell us if a particular error exists -->
<div*ngIf="newOrderForm.controls['firstName'].hasError('required') && newOrderForm.controls['firstName'].touched"class="alert alert-danger">You must include a first name.</div>
<!-- The hasError method can work with the built in validators but custom validators as well -->
<div*ngIf="newOrderForm.controls['lastName'].hasError('required') && newOrderForm.controls['lastName'].touched"class="alert alert-danger">You must include a last name.</div>
<div*ngIf="newOrderForm.controls['lastName'].hasError('minlength') && newOrderForm.controls['lastName'].touched"class="alert alert-danger">Your last name must be at least 5 characters long.</div>
<div*ngIf="newOrderForm.controls['lastName'].hasError('maxlength') && newOrderForm.controls['lastName'].touched"class="alert alert-danger">Your last name cannot exceed 10 characters.</div>
</div>
<divclass="form-group">
<label>Gender</label>
<divclass="alert alert-danger"*ngIf="!newOrderForm.controls['gender'].valid && complexForm.controls['gender'].touched">You must select a gender.</div>