1.0.10 • Published 2 years ago

@von-development-studio/primeng-form-validation v1.0.10

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

PrimeNG Form Validation

This library was generated with Angular CLI version 11.0.3.

Installing

  1. Add NPM package into your project:

    npm i @von-development-studio/primeng-form-validation -S
  2. Add VonPrimengFormModule into imports section

    import { VonPrimengFormModule } from '@von-development-studio/primeng-form-validation';
    
    ...
    
    @NgModule({
      imports: [
        ...
        VonPrimengFormModule,
        ...
      ]
    })
    export class AppModule { }

Usage

  1. Add attribute (validate) (instead of submit or ngSubmit) & novalidate in form tag:

    <form (validate)="login()" novalidate>
  2. In each field you want to add a validation:

    <input pInputText validation type="text" name="username" [(ngModel)]="login.username" [required]="true" />
  1. Your button type should be submit:

    <button type="submit">Login</button>

Directives

  • required: Checks null value

    <input name="requiredField" [(ngModel)]="value" [required]="true" validation />
  • equalTo: Checks a value is equal to (value or variable)

    <input name="eqField01" [(ngModel)]="value01" equalTo="TEST" validation />
    <input name="eqField02" [(ngModel)]="value02" [equalTo]="value01" validation />

Default validation messages

  • requiredMessage: The field '${name}' is required
  • equalToMessage: The field '${name}' is not equal
By Von Development Studio
1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1-SNAPSHOT-5

3 years ago

0.0.1-SNAPSHOT-4

4 years ago

0.0.1-SNAPSHOT-3

4 years ago

0.0.1-SNAPSHOT-2

5 years ago

0.0.1-SNAPSHOT

5 years ago

0.0.1-SNAPSHOT-1

5 years ago