https://github.com/kylekarpack/ngx-auto-validate
Automatic client-side validation for Angular
https://github.com/kylekarpack/ngx-auto-validate
angular angular-library angular7 ngx typescript validation
Last synced: 4 days ago
JSON representation
Automatic client-side validation for Angular
- Host: GitHub
- URL: https://github.com/kylekarpack/ngx-auto-validate
- Owner: kylekarpack
- License: mit
- Created: 2019-05-13T22:02:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2026-01-11T07:47:06.000Z (2 months ago)
- Last Synced: 2026-01-11T13:50:13.517Z (2 months ago)
- Topics: angular, angular-library, angular7, ngx, typescript, validation
- Language: TypeScript
- Homepage: https://kylekarpack.github.io/ngx-auto-validate/
- Size: 3.29 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Not Maintained
This library is not maintained and may not work with newer versions of Angular
# ngx-auto-validate
ngx-auto-validate is a validation module for Angular that favors dynamic element modification to show client-side validation errors. It's a good solution for large forms or applications where writing out all validation combinations could result in excess HTML in your templates.
Inspired by https://netbasal.com/make-your-angular-forms-error-messages-magically-appear-1e32350b7fa5 and https://jonsamwell.github.io/angular-auto-validate
## Installation
```
npm install ngx-auto-validate
```
or
```
yarn add ngx-auto-validate
```
## Usage:
Import this library in your ```app.module.ts```:
```typescript
import {
NgxAutoValidateModule
} from "ngx-auto-validate";
@NgModule({
// ...
imports: [
ReactiveFormsModule,
NgxAutoValidateModule.forRoot({
errors: {
errorType: "Error text"
// ex. required: "This field is required"
// ...
},
classes: {
validationMessage: "text-danger small"
// ...
},
texts: {
defaultError: "Validation error",
// ...
}
}),
// ...
]
})
export class AppModule {}
```
## ToDo:
* Add additional validation types
* Currently works best with Bootstrap 4 DOM structure
* Add customization strategies
* Integrate with more validators (i.e. https://www.npmjs.com/package/ng2-validation)