1.0.5 • Published 2 years ago
ng-fad-test00 v1.0.5
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
Name | Type | Required | Description |
---|---|---|---|
enableAs | boolean | no | Run liveness check on the captured images |
calculateNFIQ | boolean | no | Notify the server to calculate NFIQ score on each finger |
wsqCompression | WSQCompression | no | Compression of the WSQ Templates |
asThreshold | AsThreshold | true | Strictness of AS logic, (VERY HIGH, HIGH, MEDIUM, LOW) |
requiredTemplates | Template[] | no | List of templates to be obtained |
detectionModes | FingerDetectionMode[] | true | Hand (right or left) and fingers (4F or thumb) to capture |
showCaptureTraining | boolean | no | Show the user training dialog at the beginning of a capture |
showOrientationDialog | boolean | no | Show SDK based orientation dialog. To Prevent capture in landscape mode |
captureTimeout | number | no | Set 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
Name | Return | Description |
---|---|---|
oncomplete | object | Event that runs when capture completes successfully |