Answers for "angular form validation whitespace"

0

angular form validation whitespace

public noWhitespaceValidator(control: FormControl) {
    const isWhitespace = (control.value || '').trim().length === 0;
    const isValid = !isWhitespace;
    return isValid ? null : { 'whitespace': true };
}
Posted by: Guest on September-11-2020
0

angular form validation whitespace

<div *ngIf="yourForm.hasError('whitespace')">Please enter valid data</div>
Posted by: Guest on September-11-2020
0

angular form validation whitespace

new FormControl(field.fieldValue || '', [Validators.required, this.noWhitespaceValidator])
Posted by: Guest on September-11-2020

Code answers related to "angular form validation whitespace"

Code answers related to "Javascript"

Browse Popular Code Answers by Language