Skip to content
Automatic client-side validation for Angular
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
projects
.editorconfig
.gitignore
LICENSE
README.md
_config.yml
angular.json
package-lock.json
package.json
tsconfig.json
tslint.json
yarn.lock

README.md

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:

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:

You can’t perform that action at this time.