From 63383c186d4b912894ed83b652c36a22eb4e4f2c Mon Sep 17 00:00:00 2001 From: Sam Severance Date: Mon, 17 May 2021 13:50:29 -0400 Subject: [PATCH] docs: use `ValidationErrors` interface in Form validation examples (#42135) PR Close #42135 --- .../form-validation/src/app/shared/forbidden-name.directive.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aio/content/examples/form-validation/src/app/shared/forbidden-name.directive.ts b/aio/content/examples/form-validation/src/app/shared/forbidden-name.directive.ts index 5b9e2c4c24..f6bb002cec 100644 --- a/aio/content/examples/form-validation/src/app/shared/forbidden-name.directive.ts +++ b/aio/content/examples/form-validation/src/app/shared/forbidden-name.directive.ts @@ -5,7 +5,7 @@ import { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorF // #docregion custom-validator /** A hero's name can't match the given regular expression */ export function forbiddenNameValidator(nameRe: RegExp): ValidatorFn { - return (control: AbstractControl): {[key: string]: any} | null => { + return (control: AbstractControl): ValidationErrors | null => { const forbidden = nameRe.test(control.value); return forbidden ? {forbiddenName: {value: control.value}} : null; };