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 0c4f8b18c0..60510fe6c6 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 @@ -1,6 +1,6 @@ // #docregion -import { Directive, Input, OnChanges, SimpleChanges } from '@angular/core'; -import { AbstractControl, NG_VALIDATORS, Validator, ValidatorFn, Validators } from '@angular/forms'; +import { Directive, Input } from '@angular/core'; +import { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn } from '@angular/forms'; // #docregion custom-validator /** A hero's name can't match the given regular expression */ @@ -22,7 +22,7 @@ export function forbiddenNameValidator(nameRe: RegExp): ValidatorFn { export class ForbiddenValidatorDirective implements Validator { @Input('appForbiddenName') forbiddenName: string; - validate(control: AbstractControl): {[key: string]: any} | null { + validate(control: AbstractControl): ValidationErrors | null { return this.forbiddenName ? forbiddenNameValidator(new RegExp(this.forbiddenName, 'i'))(control) : null; } diff --git a/aio/content/guide/attribute-binding.md b/aio/content/guide/attribute-binding.md index d051319b5e..81597a9fea 100644 --- a/aio/content/guide/attribute-binding.md +++ b/aio/content/guide/attribute-binding.md @@ -150,7 +150,7 @@ The following table summarizes class binding syntax.
"my-class-1 my-class-2 my-class-3"
{[key: string]: boolean | undefined | null}
Record<string, boolean | undefined | null>
{foo: true, bar: false}
"width: 100px; height: 100px"
{[key: string]: string | undefined | null}
Record<string, string | undefined | null>
{width: '100px', height: '100px'}