angular-super-validator
v2.0.0
Published
Angular4 Deep Form Validator
Downloads
1,419
Maintainers
Readme
angular-super-validator
A form validator library for deep validation and error extraction from Angular Forms
Install
$ npm install --save angular-super-validator
Import
import { SuperForm } from "angular-super-validator";
Use in FormGroup
const fg = new FormGroup({
id: new FormControl(0, [Validators.required]),
name: new FormControl('', [Validators.required]),
description: new FormControl('', [Validators.required, Validators.maxLength(200)]),
isSkipped: new FormControl(false),
});
if (!fg.valid) {
const errors = SuperForm.getAllErrors(fg);
const errorsFlat = SuperForm.getAllErrorsFlat(fg);
console.log(errors);
}
Made with :heart: in :uk: