ng2-uidai-validation
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

ng2-uidai-validation

Description

This library is based on https://groups.google.com/forum/#!topic/aadhaarauth/eB5hOU-Qtq0 This library test whether a given number validates standards defined by UIDAI

Installation

To install this library, run:

$ npm install ng2-uidai-validation --save

Consuming your library

Once you have published your library to npm, you can import your library in any Angular application by running:

$ npm install ng2-uidai-validation

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
 
import { AppComponent } from './app.component';
 
// Import your library
import { UidaiValidationModule } from 'ng2-uidai-validation';
 
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
 
    // Specify your library as an import
    UidaiValidationModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once your library is imported, you can use its components, directives and pipes in your Angular application:


import { Component } from '@angular/core';
import { UidaiValidationService } from './uidai-validation.service';

@Component({
  selector: 'sample-component',
  template: `<h1>Sample component</h1>`
})
export class SampleComponent {
 public uidaiNo='234123412346';//Number should be string format
  constructor(private uidaiValidationService:UidaiValidationService) {

 let isValidUidaiNo=this.uidaiValidationService.isValidUidaiNumber(this.uidaiNo);//true or false
 
  }
   
}

License

MIT © nandakumar-r

Package Sidebar

Install

npm i ng2-uidai-validation

Weekly Downloads

101

Version

1.0.0

License

MIT

Unpacked Size

15.2 kB

Total Files

9

Last publish

Collaborators

  • nandangalaxies