Skip to content

API Reference


API Reference / @dasch-ng/validators / JsonValidatorDirective

Class: JsonValidatorDirective ​

Defined in: json/json.validator.ts:26

Template-driven version of jsonValidator: <textarea ngModel validateJson></textarea>.

Implements ​

  • Validator

Constructors ​

Constructor ​

new JsonValidatorDirective(): JsonValidatorDirective

Returns ​

JsonValidatorDirective

Methods ​

validate() ​

validate(control): ValidationErrors | null

Defined in: json/json.validator.ts:27

Parameters ​

control ​

AbstractControl

The control to validate against.

Returns ​

ValidationErrors | null

A map of validation errors if validation fails, otherwise null.

Description ​

Method that performs synchronous validation against the provided control.

Implementation of ​

Validator.validate

Released under the MIT License.