]>
Commit | Line | Data |
---|---|---|
e309822b | 1 | import { Injectable } from '@angular/core' |
66357162 | 2 | import { Validators } from '@angular/forms' |
67ed6552 | 3 | import { BuildFormValidator } from './form-validator.service' |
e309822b C |
4 | |
5 | @Injectable() | |
6 | export class VideoCommentValidatorsService { | |
7 | readonly VIDEO_COMMENT_TEXT: BuildFormValidator | |
8 | ||
66357162 | 9 | constructor () { |
e309822b C |
10 | this.VIDEO_COMMENT_TEXT = { |
11 | VALIDATORS: [ Validators.required, Validators.minLength(1), Validators.maxLength(3000) ], | |
12 | MESSAGES: { | |
66357162 C |
13 | 'required': $localize`Comment is required.`, |
14 | 'minlength': $localize`Comment must be at least 2 characters long.`, | |
15 | 'maxlength': $localize`Comment cannot be more than 3000 characters long.` | |
e309822b C |
16 | } |
17 | } | |
18 | } | |
19 | } |