ngx-form-validation-lib
v17.0.5
Published
A library for form validation in Angular
Readme
angular forcontroller validation-message-library
A library for form validation message in Angular.
Installation
To install this library, run:
npm i ngx-form-validation-libUsage Guide
- Import ValidationLibModule
import { ValidationLibModule } from 'ngx-form-validation-lib';
@NgModule({
imports: [ValidationLibModule],
})
export class AppModule {}- Add ngx-input to templete.html
<ngx-input
[label]="'Email'"
[type]="'text'"
formControlName="email"
></ngx-input>- add formController in component.ts
form: new FormGroup({
email : new FormControl('',[Validators.required,Validators.email]),
})
onSubmit() {
if (this.form.invalid) {
this.form.markAllAsTouched();
return;
}
}Helpers
#The library provides a validation message for formcontroller
. onSubmit . Required . Email . Pattern . Touched . Dirty
License
This project is licensed under the MIT License - see the LICENSE file for details.
