From 7ed1edbbe4ffbef28093e4f5630751cb652814e4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Aug 2020 11:47:04 +0200 Subject: We don't need services anymore for validators --- .../app/shared/form-validators/video-comment-validators.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 client/src/app/shared/form-validators/video-comment-validators.ts (limited to 'client/src/app/shared/form-validators/video-comment-validators.ts') diff --git a/client/src/app/shared/form-validators/video-comment-validators.ts b/client/src/app/shared/form-validators/video-comment-validators.ts new file mode 100644 index 000000000..c56564d34 --- /dev/null +++ b/client/src/app/shared/form-validators/video-comment-validators.ts @@ -0,0 +1,11 @@ +import { Validators } from '@angular/forms' +import { BuildFormValidator } from './form-validator.model' + +export const VIDEO_COMMENT_TEXT_VALIDATOR: BuildFormValidator = { + VALIDATORS: [ Validators.required, Validators.minLength(1), Validators.maxLength(3000) ], + MESSAGES: { + 'required': $localize`Comment is required.`, + 'minlength': $localize`Comment must be at least 2 characters long.`, + 'maxlength': $localize`Comment cannot be more than 3000 characters long.` + } +} -- cgit v1.2.3