1.3.0 • Published 4 years ago
ng-fad-document-preview-desktop v1.3.0
Getting started
Installation
npm install ng-fad-document-preview-desktopDependencies
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 { NgFadDocumentPreviewDesktopModule } from 'ng-fad-document-preview-desktop';
.
.
.
... imports: [
...,
BrowserAnimationsModule
NgFadDocumentPreviewDesktopModule
]...Note: BrowserAnimationsModule is required.
Usage
HTML
Add the selector inside some component and configure the input parameters:
<ng-fad-document-preview-desktop
[configuration]="configuration"
[pdfSrc]="pdfSrc"
[status]="status"
[showDocumentRejection]="showDocumentRejection"
(onerror)="onerror($event)"
(onreject)="onreject()"
(oncontinue)="oncontinue()">
</ng-fad-document-preview-desktop>Typescript
Listen to the events and execute methods:
public pdfSrc = 'pdf resource';
public status = 'REJECTED' | 'PENDING' | 'TO_SIGN';
public showDocumentRejection = true;
onerror(error) {
alert(JSON.stringify(error));
}
oncontinue() {
alert('next step');
}
onmoreject() {
alert('reject document clicked')
}Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| configuration | object | false | {} | module data to be configured |
| pdfSrc | string | true | undefined | pdf resource |
| status | string | true | undefined | document status |
| showDocumentRejection | boolean | false | undefined | view to see document rejection text |
Outputs
| Name | Return | Description |
|---|---|---|
| onerror | object | Is called when an error happens |
| oncontinue | void | Is called when the user finishes the process |
| onreject | void | Is called when the user clicks on the text of reject document |