ng-fad-identy-face
v1.0.0
Published
``` npm install ng-fad-identy-face ```
Downloads
1
Keywords
Readme
Getting started
Installation
npm install ng-fad-identy-face
Dependencies
Add the folder provided by the technical team within the project assets (images and js)
Configuration project
In angular.json file add identy assets and styles
.
.
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "**/*",
"input": "projects/ng-fad-identy-face/node_modules/@identy/identy-face/dist/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "projects/ng-fad-identy-face/node_modules/@identy/identy-common/dist/assets",
"output": "./assets/"
}
],
"styles": [
"node_modules/@identy/identy-face/dist/identy-face-style.css",
"node_modules/ng-fad-identy-face/assets/style/fad-identy-face.scss"
],
.
.
In tsconfig.json or tsconfig.base.json add
{ ... compilerOptions: { ... "skipLibCheck": true, ... } ... }
Import
In the file necessary example.module.ts import the module.
In this case app.module.ts
import { NgFadIdentyFaceModule } from 'ng-fad-identy-face';
.
.
.
... imports: [
...,
BrowserAnimationsModule
NgFadIdentyFaceModule
]...
Note: BrowserAnimationsModule is required.
Usage
HTML
Add the selector inside some component
<ng-fad-identy-face
[modelURL]="modelURL"
(ondata)="ondata($event)"
(onerror)="onerror($event)">
</ng-fad-identy-face>
Typescript
import { ResponseError, IdentyFace } from 'ng-fad-identy-face';
.
.
.
modelURL: string = 'yor_model_url';
onerror(error: ResponseError) {
// manage error
}
ondata(event: IdentyFace) {
// capture result
}
Inputs
| Name | Type | Required | Default | Description | | --------------------- | --------------------- | ---------- |--------- | ---------------------------------------------------------- | | modelURL | string | true | undefined | Server url | | delay | number | false | 5000 | Set init delay |
Outputs
| Name | Return | Description | | -------------- | --------------------- | ---------------------------------------------- | | ondata | IdentyFace | Is called when capture completes successfully | | onerror | object | Is called when an error happens |