Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular form validation whitespace

public noWhitespaceValidator(control: FormControl) {
    const isWhitespace = (control.value || '').trim().length === 0;
    const isValid = !isWhitespace;
    return isValid ? null : { 'whitespace': true };
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #form #validation #whitespace
ADD COMMENT
Topic
Name
3+9 =