https://github.com/releasium/ngx-grand-validator
Powerful and easy-to-use Angular library that simplifies the process of implementing reactive form validation in your Angular applications.
https://github.com/releasium/ngx-grand-validator
angular decorator decorators error-handling error-message reactive schema validation validator
Last synced: 2 months ago
JSON representation
Powerful and easy-to-use Angular library that simplifies the process of implementing reactive form validation in your Angular applications.
- Host: GitHub
- URL: https://github.com/releasium/ngx-grand-validator
- Owner: releasium
- Created: 2020-09-06T13:52:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-02T23:38:46.000Z (almost 2 years ago)
- Last Synced: 2024-10-16T09:06:49.183Z (8 months ago)
- Topics: angular, decorator, decorators, error-handling, error-message, reactive, schema, validation, validator
- Language: TypeScript
- Homepage: https://releasium.notion.site/releasium/f29bce8995574d57ac42ae4e42db27be?v=9f9f77c10589418ea4584d317b2292af
- Size: 4.71 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @releasium/ngx-grand-validator
**@releasium/ngx-grand-validator** is a powerful and easy-to-use Angular library that simplifies the process of
implementing reactive form validation in your Angular applications. With **@releasium/ngx-grand-validator**,
developers can create models, and effortlessly add decorators to the model's
fields for validation purposes. Say goodbye to writing extensive form validation logic by hand
– let **ngx-grand-validator** handle it for you!
### Version
| @releasium/ngx-grand-validator | Angular |
|--------------------------------|---------|
| v0.14.0 | v14 |
| v0.15.0 | v15 |
| v1.16.0 LTS | v16 |
| Q4 2023 | v17 |### Features:
- **Simple Integration:** Easily integrate **@releasium/ngx-grand-validator** into your Angular projects and get started with reactive form validation in no time.
- **Model-Based Validation:** Define your data models using TypeScript classes and decorate the fields with validation decorators to describe the validation rules.
- **Schema validation.** In case of complex form just create schema and work with reactive Forms
- **FormGroup Generation:** Utilize the defined models to automatically generate Angular `FormGroup` instances with all the specified validation rules applied.
- **Declaration** working with `FormGroup`, `FormArray`, `FormControl` as well
- **Built-in Validators**: Choose from a variety of built-in validation decorators, such as `@GV.required()`, `@GV.minLength()`, `@GV.maxLength()`, `@GV.pattern()`, and more.
- **Custom Validation**: Implement custom validation rules by creating your own validation decorators.
- **Error Messaging**: Receive detailed error messages based on the defined validation rules to provide precise feedback to users.
- **Consistency and Maintainability**: Centralize your validation logic within the models, making it easier to maintain and refactor in the future.### How to start?
Install NgxGrandValidator using NPM:``npm i @releasium/ngx-grand-validator --save``
### Example of using
```
// Your Model
export class UserModel extends GVModel {
@GV.maxLength(120)
@GV.minLength(5)
@GV.required()
firstName: string;@GV.maxLength(120)
@GV.lastName(5)
@GV.required()
lastName: string;@GV.required()
@GV.email()
email: number;
}```
```
//Your Component
this.form = UserModel.createForm();
form.validate();
``````
//Yout Template
....
```### Contributing:
We welcome contributions from the open-source community. If you have found a bug or have a feature request, please submit an issue or a pull request on our GitHub repository.
### License:
This library is distributed under the MIT License. Feel free to use it in your commercial and non-commercial projects.