kwikid-fingerprint
v0.0.1
Published
Kwik.ID's EKYC Fingerprint Module.
Downloads
2
Maintainers
Readme
kwikid-fingerprint
A fully customizable, one-time password input component for the web built with Angular.
Demo
Edit on Stackbliz
Installation
npm install --save kwikid-fingerprint
Usage
Add KwikidFingerprintModule to imports app.module.ts
something like
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { KwikidFingerprintModule } from 'kwikid-fingerprint';
@NgModule({
declarations: [AppComponent],
imports: [ BrowserModule,
KwikidFingerprintModule],
bootstrap: [AppComponent]
})
Add component to your page:
<kwikid-fingerprint (onInputChange)="onOtpChange($event)" [config]="{length:5}"></kwikid-fingerprint>
API
Config options
Updating component value using setValue method
Component value can be updated using setValue
method of the component example:-
<kwikid-fingerprint #ngOtpInput ></kwikid-fingerprint> //add hash to kwikid-fingerprint component
then in your component reference using @ViewChild and call setValue
method when you want to set the value of component like
//Get reference using ViewChild and the specified hash
@ViewChild('ngOtpInput') ngOtpInputRef:any;
yourMethod(){
this.ngOtpInputRef.setValue(yourValue);
//yourvalue can be any string or number
}
Disable inputs
Inputs can be disabled by getting the otp form instance of the component and calling disable method
1.Get the component ref in the same way as done in SetValue method above 2.Call disable method of otpForm as follow
this.ngOtpInputRef.otpForm.disable();
License
Contributing
Add a star to show your support and feel free to open issues and pull requests!