0.0.1-SNAPSHOT-3 • Published 5 years ago

@von-development-studio/primeng-form-validation v0.0.1-SNAPSHOT-3

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Directive: primeng-form-validation

Custom form validation for Angular and PrimeNG.

Read this in other language: Spanish

Requirements

Installing

  1. Add NPM package into your project:

    npm install @von-development-studio/primeng-form-validation --save
  2. Add FormValidationModule into imports section

    import { FormsModule } from '@angular/forms';
    import { FormValidationModule } from '@von-development-studio/primeng-form-validation';
    
    ...
    
    @NgModule({
      imports: [
        ...
        FormsModule,
        FormValidationModule,
        ...
      ]
    })
    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 validation type="text" name="username" [(ngModel)]="login.username" required />
  1. Your button type should be submit:

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

Directives

  • required: Checks null value

    <input name="requiredField" [(ngModel)]="value" required validation />

Default validation messages

  • requiredMessage: The field ${name} is required, needs name attribute in HTML element
By Von Development Studio
1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1-SNAPSHOT-5

5 years ago

0.0.1-SNAPSHOT-4

5 years ago

0.0.1-SNAPSHOT-3

5 years ago

0.0.1-SNAPSHOT-2

6 years ago

0.0.1-SNAPSHOT

6 years ago

0.0.1-SNAPSHOT-1

6 years ago