3.0.0 • Published 2 years ago

ng-fad-signed-document-desktop v3.0.0

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

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@example.com';
  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

NameTypeRequiredDefaultDescription
configurationobjectfalse{}module data to be configured
emailstringtrueundefinedsigner's email displayed on screen
emailLimitnumberfalse6limit of emails to resend
showAdbooleanfalsundefinedshow notice

Outputs

NameReturnDescription
onerrorobjectIs called when an error happens
onsendstring[]Is called when the user continues the process
onclicktemplatevoidIs called when the user has interaction the ad
oneventprocessProcessIs 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

3.0.0

2 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago