]>
Commit | Line | Data |
---|---|---|
4b2f33f3 C |
1 | import { Validators } from '@angular/forms'; |
2 | ||
ad4a8a1c C |
3 | import { validateEmail } from './email.validator'; |
4 | ||
4b2f33f3 C |
5 | export const USER_USERNAME = { |
6 | VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(20) ], | |
7 | MESSAGES: { | |
8 | 'required': 'Username is required.', | |
9 | 'minlength': 'Username must be at least 3 characters long.', | |
10 | 'maxlength': 'Username cannot be more than 20 characters long.' | |
11 | } | |
12 | }; | |
ad4a8a1c C |
13 | export const USER_EMAIL = { |
14 | VALIDATORS: [ Validators.required, validateEmail ], | |
15 | MESSAGES: { | |
16 | 'required': 'Email is required.', | |
17 | 'email': 'Email must be valid.', | |
18 | } | |
19 | }; | |
4b2f33f3 C |
20 | export const USER_PASSWORD = { |
21 | VALIDATORS: [ Validators.required, Validators.minLength(6) ], | |
22 | MESSAGES: { | |
23 | 'required': 'Password is required.', | |
24 | 'minlength': 'Password must be at least 6 characters long.', | |
25 | } | |
26 | }; |