required validator allows space in angular 9 code example
Example 1: angular form validation whitespace
<div *ngIf="yourForm.hasError('whitespace')">Please enter valid data</div>
Example 2: angular form validation whitespace
new FormControl(field.fieldValue || '', [Validators.required, this.noWhitespaceValidator])