0.1.7 • Published 2 years ago

ngx-nic-parser v0.1.7

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

Calculate DOB/Gender for Srilankan National Identity Card using Angular

NPM version The MIT License The MIT License

Getting started

Step 1: Install ng-bootstrap

   ng add @ng-bootstrap/ng-bootstrap

Step 2: Install ngx-nic-parser

    npm install ngx-nic-parser --save

Example usage:

Add the NgxNicParserModule to the imports of the module.

      import {NgxNicParserModule} from "ngx-nic-parser";

      @NgModule({
        imports: [
          NgxNicParserModule
        ]
      })

Add the element to your HTML:

<ngx-nic-parser
  [title]="'title'"
  [placeholder]="'placeholder'"
  (checkDob)="generate($event)"
  [id]="'id'"
  [patternErrorMessage]="'invalid pattern!'"
  [requiredMessage]="'is required!'">
</ngx-nic-parser>

And add this to your ts file:

export class AppComponent {
  generate($event: any) {
    console.log($event);
  }
}

Success Response

{
    "status": {
        "code": 200,
        "message": ""
    },
    "response": {
        "day": 9,
        "monthName": "JUNE",
        "month": 6,
        "year": 1999,
        "gender": "Male",
        "weekDay": "Friday"
    }
}

Inputs

NameTypeDefaultDescription
titlestringnullLabel Name
placeholderstringnullplaceholder for the input field.
idstringnullId for input field.
patternErrorMessagestringnullError Message when input an incorrect pattern.
requiredMessagestringnullField is required message.

Outputs

NameTypeDescription
checkDobmethodMethod to calculate DOB
0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago