I have a TypeScript code block:
dataxForm: fromGroup
this.dataxForm = new FormGroup({
'Description':new FormControl(null, Validaros.required};
'Name':new FormControl(null, Validators.required})
Here is an HTML snippet:
<mat-divider></mat-divider>
<form [formGroup]="dataxForm">
<ng-template #editDescription>
<input formControlName = "Description item">
<textarea matInput cdsTextareaAutosize [formControl]="controls.description"></textarea>
<small class="text-danger" *ngIf=dataxForm.get('Description').invalid || dataxForm.get('Description').touched"> Description is a required field></small>
<mat-divider></mat-divider>
<form [formGroup]="dataxForm">
<ng-template #editDescription>
<input formControlName = "Name">
<textarea matInput cdsTextareaAutosize [formControl]="controls.description"></textarea>
<small class="text-danger" *ngIf=dataxForm.get('Name').invalid || dataxForm.get('Name').touched"> Name is a required field></small>
<button mat-button [disabled] = "dataxForm.invalid (click)="submitForm">Submit Form</button>
Upon page load, I am facing two issues with validation errors: 1) How can I remove the error message beneath the input fields once the validation requirements are met? 2) How do I enable the submit button when all validation requirements are satisfied?