ng2-uidai-validation
v1.0.0
Published
## Description
Downloads
203
Maintainers
Readme
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