If you're looking to improve your knowledge on Angular forms and form validation, it's highly recommended that you visit the following link for detailed guidance: https://angular.io/guide/forms-overview
There are numerous methods available to accomplish this task, but utilizing a required validator should suffice for your requirements. Below is a sample code snippet demonstrating how it can be implemented.
HTML FILE
<form #f="ngForm" [formGroup]="generalForm">
<input type="text" class="form-control" name="error" formControlName="error">
</form>
<button class="btn btn-danger" [disabled]="!f.valid" (click)="save()"> Save </button>
TS FILE
generalSettingsForm = new FormGroup({
error: new FormControl("",Validators.required),
});