2.0.1 • Published 3 years ago
test-private-package2 v2.0.1
Getting started
Installation
npm install ng-fad-signature-expressDependencies
Add the folder provided by the technical team within the project assets (images and js)
Import
In the file necessary example.module.ts import the module.
In this case app.module.ts
import { NgFadSignatureExpressModule } from 'ng-fad-signature-express';
.
.
.
... imports: [
...,
BrowserAnimationsModule
NgFadSignatureModule
]...Note: BrowserAnimationsModule is required.
Usage
HTML
Add the selector inside some component and configure the output events:
<ng-fad-signature-express
(configuration)="configuration"
(onerror)="onerror($event)"
(oncomplete)="oncomplete($event)"
(acceptCamera)="acceptCamera()">
</ng-fad-signature-express>Typescript
Listen to the events:
import { Configuration, ResponseSuccess, ResponseError, ErrorCode, CONFIGURATION_DEFAULT } from 'ng-fad-signature-express';
.
.
.
configuration: Configuration = {
selfie: {
captureSelfie: true,
imageType: 'image/png',
imageQuality: 1
}
};
.
.
.
oncomplete(response: ResponseSuccess) {
console.log(response);
}
onerror(error: ResponseError) {
console.log(error);
// if (error.code === ErrorCode.BROWSER_NOT_SUPPORTED) // do something
}
acceptCamera() {
console.log('cammera accepted');
}Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| configuration | Configuration | false | CONFIGURATION_DEFAULT | Module data to be configured |
Outputs
| Name | Return | Description |
|---|---|---|
| oncomplete | ResponseSuccess | Fires when the process completes successfully |
| acceptCamera | void | Fires when the user accepts the camera permissions |
| onerror | ResponseError | Is called when an error happens |
2.0.1
3 years ago