-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add whitespace validation * Update whitespace validation for new issue * Update whitespace validation for title of new issues * Update whitespace validation for title of new issues * Move validators into core * Update import order --------- Co-authored-by: Misra Aditya <[email protected]>
- Loading branch information
1 parent
b20b3ef
commit fe7be44
Showing
3 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms'; | ||
|
||
export function noWhitespace(): ValidatorFn { | ||
return (title: AbstractControl): ValidationErrors | null => { | ||
if (title.value && title.value.trim() === '') { | ||
return { whitespace: true }; | ||
} | ||
return null; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters