]>
Commit | Line | Data |
---|---|---|
26b7305a C |
1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | |
3 | import { Injectable } from '@angular/core' | |
4 | import { BuildFormValidator } from '@app/shared' | |
5 | ||
6 | @Injectable() | |
5baee5fc RK |
7 | export class VideoBlockValidatorsService { |
8 | readonly VIDEO_BLOCK_REASON: BuildFormValidator | |
26b7305a C |
9 | |
10 | constructor (private i18n: I18n) { | |
5baee5fc | 11 | this.VIDEO_BLOCK_REASON = { |
26b7305a C |
12 | VALIDATORS: [ Validators.minLength(2), Validators.maxLength(300) ], |
13 | MESSAGES: { | |
5baee5fc RK |
14 | 'minlength': this.i18n('Block reason must be at least 2 characters long.'), |
15 | 'maxlength': this.i18n('Block reason cannot be more than 300 characters long.') | |
26b7305a C |
16 | } |
17 | } | |
18 | } | |
19 | } |