/** Angular Imports */ import { Component , OnInit } from '@angular/core' ; import { DomSanitizer } from '@angular/platform-browser' ; import { ActivatedRoute } from '@angular/router' ; /**
 * View Transaction Reciept Component
 */ @ Component ( { selector : 'mifosx-view-reciept' , templateUrl : './view-reciept.component.html' , styleUrls : [ './view-reciept.component.scss' ] } ) export class ViewRecieptComponent implements OnInit { /** trusted resource url for pentaho output */ pentahoUrl : any ; /** Transaction Reciept Data */ transactionRecieptData : any ; param { DomSanitizer } sanitizer param { ActivatedRoute } route constructor ( private sanitizer , private route ) { this . route . data . subscribe ( ( data ) => { this . transactionRecieptData = data . savingsTransactionReciept ; } ) ; } ngOnInit ( ) { const contentType = this . transactionRecieptData . headers . get ( 'Content-Type' ) ; const file = new Blob ( [ this . transactionRecieptData . body ] , { type : contentType } ) ; const filecontent = URL . createObjectURL ( file ) ; this . pentahoUrl = this . sanitizer . bypassSecurityTrustResourceUrl ( filecontent ) ; } }