aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators/video.ts
blob: 3766d4018b4df670a4a2541139c41836b03a9d66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Validators } from '@angular/forms';

export const VIDEO_NAME = {
  VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(50) ],
  MESSAGES: {
    'required': 'Video name is required.',
    'minlength': 'Video name must be at least 3 characters long.',
    'maxlength': 'Video name cannot be more than 50 characters long.'
  }
};
export const VIDEO_DESCRIPTION = {
  VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(250) ],
  MESSAGES: {
    'required': 'Video description is required.',
    'minlength': 'Video description must be at least 3 characters long.',
    'maxlength': 'Video description cannot be more than 250 characters long.'
  }
};

export const VIDEO_TAGS = {
  VALIDATORS: [ Validators.pattern('^[a-zA-Z0-9]{2,10}$') ],
  MESSAGES: {
    'pattern': 'A tag should be between 2 and 10 alphanumeric characters long.'
  }
};