1.0.5 • Published 2 years ago

ng-fad-test00 v1.0.5

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

Getting started

Installation

Configuration files

In the project's angular.json file, the module's assets folder must be added.

.
.
"assets": [
    "src/favicon.ico",
    "src/assets",
    {
    "glob": "**/*",
    "input": "node_modules/ng-fad-fingerprints/src/lib/assets",
    "output": "./assets/"
    }
],
.
.

In the project's tsconfig.json file, in compilerOptions the field "skipLibCheck" must be added as true.

.
.
"compilerOptions": {
    .
    .
    .
    "moduleResolution": "node",
    "skipLibCheck": true,
    .
    .
    .
}
.
.

Styles

In the styles.scss file (global styles) import the module styles.

@import '../node_modules/ng-fad-fingerprints/src/lib/assets/fad-finger-style.css';

Import

In the file necessary example.module.ts import the module.

In this case app.module.ts

import { NgFadFingerprintsModule } from 'ng-fad-fingerprints';
.
.
.
... imports: [
       ...,
       BrowserAnimationsModule 
       NgFadFingerprintsModule
    ]...

Note: BrowserAnimationsModule is required.

Usage

HTML

Add the selector inside some component

<ng-fad-fingerprints 
    (onerror)="onerror($event)" 
    (oncomplete)="oncomplete($event)">
</ng-fad-fingerprints>

Typescript

Access the module's methods through the ViewChild decorator.

Pass the input object to the module's methods.

import { NgFadFingerprintsComponent } from 'ng-fad-fingerprints';
.
.
.
@ViewChild(NgFadFingerprintsComponent) fingerprints: NgFadFingerprintsComponent;
 
this.fingerprints.capture(this.options);

oncomplete(event: any) {
   // capture result
}

List of available methods

capture(options: SdkOptionsType) {
    // capture the fingerprints
}

Inputs

NameTypeRequiredDescription
enableAsbooleannoRun liveness check on the captured images
calculateNFIQbooleannoNotify the server to calculate NFIQ score on each finger
wsqCompressionWSQCompressionnoCompression of the WSQ Templates
asThresholdAsThresholdtrueStrictness of AS logic, (VERY HIGH, HIGH, MEDIUM, LOW)
requiredTemplatesTemplate[]noList of templates to be obtained
detectionModesFingerDetectionMode[]trueHand (right or left) and fingers (4F or thumb) to capture
showCaptureTrainingbooleannoShow the user training dialog at the beginning of a capture
showOrientationDialogbooleannoShow SDK based orientation dialog. To Prevent capture in landscape mode
captureTimeoutnumbernoSet capture timeout
Template Type
PNG
ISO_19794_2
ISO_19794_4
RAW
WSQ
AsThreshold Type
LOW
MEDIUM
HIGH
VERY_HIGH
WSQCompression Type
WSQ_5_1
WSQ_10_1
WSQ_15_1
WSQ_20_1
FingerDetectionMode Type
L4F
R4F
RIGHT_INDEX
RIGHT_MIDDLE
RIGHT_RING
RIGHT_LITTLE
LEFT_INDEX
LEFT_MIDDLE
LEFT_RING
LEFT_LITTLE
RIGHT_THUMB
LEFT_THUMB

Example on how to indicate the capture options.

import { 
    NgFadFingerprintsComponent, 
    SdkOptionsType, FingerDetectionMode, 
    WSQCompression, Template, AsThreshold 
} from 'ng-fad-fingerprints';
.
.
.
options: SdkOptionsType = {
    enableAS: true,
    asThreshold: AsThreshold.MEDIUM,
    calculateNFIQ: true,
    requiredTemplates: [Template.PNG, Template.WSQ],
    wsqCompression: WSQCompression.WSQ_15_1,
    showCaptureTraining: true,
    captureTimeout: 30000,
    showOrientationDialog: true,
    detectionModes: [ FingerDetectionMode.LEFT_THUMB, FingerDetectionMode.RIGHT_THUMB ]
}

Outputs

NameReturnDescription
oncompleteobjectEvent that runs when capture completes successfully