/** Angular Imports */ import { Component , Inject , OnInit } from '@angular/core' ; import { MatDialogRef , MAT_DIALOG_DATA } from '@angular/material/dialog' ; import { DomSanitizer } from '@angular/platform-browser' ; /** Custom Services */ import { ClientsService } from 'app/clients/clients.service' ; /**
 * View signature dialog component.
 */ @ Component ( { selector : 'mifosx-view-signature-dialog' , templateUrl : './view-signature-dialog.component.html' , styleUrls : [ './view-signature-dialog.component.scss' ] } ) export class ViewSignatureDialogComponent implements OnInit { /** Id of client signature in documents */ signatureId : any ; /** Signature Image */ signatureImage : any ; /** Client Id */ clientId : any ; param { MatDialogRef } dialogRef param { any } data constructor ( public dialogRef , private clientsService , private sanitizer , @ Inject ( MAT_DIALOG_DATA ) public data ) { const signature = this . data . documents . find ( ( document ) => document . name === 'clientSignature' ) || { } ; this . signatureId = signature . id ; this . clientId = this . data . id ; console . log ( this . clientId ) ; } ngOnInit ( ) { if ( this . signatureId ) { this . clientsService . getClientSignatureImage ( this . clientId , this . signatureId ) . subscribe ( ( base64Image ) => { this . signatureImage = this . sanitizer . bypassSecurityTrustResourceUrl ( base64Image ) ; } , ( error ) => { } ) ; } } }