2.0.1 • Published 3 years ago

test-private-package2 v2.0.1

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

Getting started

Installation

npm install ng-fad-signature-express

Dependencies

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

NameTypeRequiredDefaultDescription
configurationConfigurationfalseCONFIGURATION_DEFAULTModule data to be configured

Outputs

NameReturnDescription
oncompleteResponseSuccessFires when the process completes successfully
acceptCameravoidFires when the user accepts the camera permissions
onerrorResponseErrorIs called when an error happens