如何在角材表格中单击特定ID来打开bill-pdf /发票?

时间:2019-05-07 15:28:09

标签: angular command-line-interface

enter image description here在单击orderId时,我想打开该特定orderId的pdf /发票,该pdf /发票在pdf文件夹中可用,并以对话框格式显示。

html

<ng-container matColumnDef="orderId">
<mat-header-cell *matHeaderCellDef> orderId </mat-header-cell>
<mat-cell *matCellDef="let element">
<a (click)="openPdf(element.orderId)">{{element.orderId}}</a>
</mat-cell>
</ng-container>

ts

openPdf(orderId){
let invoice : any =document.querySelector('invoice_2.pdf');
 if(typeof (FileReader) !== 'undefined'){
    let reader = new FileReader();
    reader.onload = (e:any)=>{
      this.pdfSrc = e.target.result;
    }
    reader.readAsArrayBuffer(invoice.files[0]);
  }
}

我希望在单击orderId对话框时会打开带有特定orderId的发票/ pdf。

0 个答案:

没有答案