array
Validate that the value is a JavaScript array (Array.isArray).
Signature
NguardValidators.Array.array: ValidatorFn
Reactive forms
import { FormControl, FormGroup } from '@angular/forms';
import { NguardValidators } from 'ng-nguard';
const form = new FormGroup({
tags: new FormControl([], [NguardValidators.Array.array]),
});
Template-driven forms
<input ngModel name="tags" nguardArray />
Error key
{ array: true }
Notes
null,undefined, objects and array-like values are rejected — only true arrays pass.