https://github.com/naologic/angular-super-validator
A form validator library for deep validation and error extraction
https://github.com/naologic/angular-super-validator
angular angular-cli angular4 angular5 error-extraction forms validator
Last synced: 16 days ago
JSON representation
A form validator library for deep validation and error extraction
- Host: GitHub
- URL: https://github.com/naologic/angular-super-validator
- Owner: naologic
- License: mit
- Created: 2017-10-29T13:31:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-30T23:29:07.000Z (almost 7 years ago)
- Last Synced: 2025-04-01T15:11:51.705Z (28 days ago)
- Topics: angular, angular-cli, angular4, angular5, error-extraction, forms, validator
- Language: TypeScript
- Size: 213 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-super-validator
[](https://badge.fury.io/js/angular-super-validator)



A form validator library for deep validation and error extraction from Angular Forms
## Install
```sh
$ npm install --save angular-super-validator
```## Import
```typescript
import { SuperForm } from "angular-super-validator";
```## Use in FormGroup
```typescript
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: