3.1.0 • Published 2 years ago

ng-fad-signed-document v3.1.0

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

Getting started

Installation

npm install ng-fad-signed-document

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 { NgFadSignedDocumentModule } from 'ng-fad-signed-document';
.
.
.
... imports: [
       ...,
       BrowserAnimationsModule 
       NgFadSignedDocumentModule
    ]...

Note: BrowserAnimationsModule is required.

Usage

HTML

Add the selector inside some component and configure the input parameters:

  <ng-fad-signed-document
    [configuration]="configuration"
    [email]="email"
    [emailLimit]="emailLimit"
    [canResend]="canResend"
    [template]="template"
    [showAd]="showAd"
    (onsend)="onsend($event)"
    (onerror)="onerror($event)"
    (onclose)="onclose()"
    (oneventprocess)="oneventprocess($event)"
    (onclicktemplate)="onclicktemplate()">
  </ng-fad-signed-document>

Typescript

Listen to the events and execute methods:

  public configuration = {};
  public email = 'email@example.com';
  public emailLimit = 4;
  public canResend = true;
  template = null;
  showAd = false;
  @ViewChild(NgFadSignedDocumentComponent) signedDocument: NgFadSignedDocumentComponent;

  onerror(error) {
    alert(JSON.stringify(error));
  }

  onsend(emails: string[]) {
    // Do something
    // if process is correct
    this.signedDocument.showSuccess();
  }

  onclose() {
    // Do something after onsend event
  }

  oneventprocess('SUCCESS_SEND_MAIL' | 'CLOSE_MAILS' | 'OPEN_MAILS') {
    // Do something after oneventprocess 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 document
canResendbooleanfalsetrueoption to resend document
templatebooleanfalseundefinedcustom template to display at the end of the component
showAdbooleanfalseundefined or false (if template has content)show notice

Outputs

NameReturnDescription
onerrorobjectIs called when an error happens
onsendstring[]Is called when the user continues the process
onclosevoidIs called when the user ends the process
oneventprocessProcessIs called when the user has interaction with some elements *
onclicktemplatevoidIs called when the user has interaction the ad

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.signedDocument.showSuccess(); CLOSE_MAILS: is sent when the screen to enter emails is closed OPEN_MAILS: is sent whe the user open the screen to send emails

3.1.0

2 years ago

3.0.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.1

2 years ago

1.1.2

2 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago