validation space in textbox angular 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])