ng-fad-signed-document-desktop
v3.0.0
Published
``` npm install ng-fad-signed-document-desktop ```
Downloads
9
Keywords
Readme
Getting started
Installation
npm install ng-fad-signed-document-desktop
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 { NgFadSignedDocumentDesktopModule } from 'ng-fad-signed-document-desktop';
.
.
.
... imports: [
...,
BrowserAnimationsModule
NgFadSignedDocumentDesktopModule
]...
Note: BrowserAnimationsModule is required.
Usage
HTML
Add the selector inside some component and configure the input parameters:
<ng-fad-signed-document-desktop
[configuration]="configuration"
[email]="email"
[emailLimit]="emailLimit"
[showAd]="showAd"
(onsend)="onsend($event)"
(onerror)="onerror($event)"
(onclicktemplate)="onclicktemplate()"
(oneventprocess)="oneventprocess($event)">
</ng-fad-signed-document-desktop>
Typescript
Listen to the events and execute methods:
public configuration = {};
public email = '[email protected]';
public emailLimit = 3;
public showAd = false;
@ViewChild(NgFadSignedDocumentDesktopComponent) signedDocumentDesktop: NgFadSignedDocumentDesktopComponent;
onerror(error) {
alert(JSON.stringify(error));
}
onsend(emails: string[]) {
// Do something
// if process is correct
this.signedDocumentDesktop.showSuccess();
// if process is incorrect
this.signedDocumentDesktop.showError();
}
oneventprocess(process: string) 'SUCCESS_SEND_MAIL' | 'CLOSE_MAILS' | 'OPEN_MAILS') {
// Do something after onclosebyprocess event
}
onclicktemplate() {
// Do something after onclicktemplate event
}
Inputs
| Name | Type | Required | Default | Description | | ---------------- | ------- | -----------| ------------ | ------------------------------------------ | | configuration | object | false | {} | module data to be configured | | email | string | true | undefined | signer's email displayed on screen | | emailLimit | number | false | 6 | limit of emails to resend | | showAd | boolean | fals | undefined | show notice |
Outputs
| Name | Return | Description | | ----------------- | --------- | -------------------------------------------------------------- | | onerror | object | Is called when an error happens | | onsend | string[] | Is called when the user continues the process | | onclicktemplate | void | Is called when the user has interaction the ad | | oneventprocess | Process | Is called when the user has interaction with some elements * |
oneventprocess
export enum Process {
SUCCESS_SEND_MAIL = 'SUCCESS_SEND_MAIL',
CLOSE_MAILS = 'CLOSE_MAILS',
OPEN_MAILS = 'OPEN_MAILS'
}
SUCCESS_SEND_MAIL: is sent after the method this.signedDocumentDesktop.showSuccess(); CLOSE_MAILS: is sent when the user remove all emails OPEN_MAILS: is sent whe the user open the screen to send emails