Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/456.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用ng2 pdf查看器时出错_Javascript_Angularjs - Fatal编程技术网

Javascript 使用ng2 pdf查看器时出错

Javascript 使用ng2 pdf查看器时出错,javascript,angularjs,Javascript,Angularjs,我在angular 2应用程序中使用ng2 pdf viewer时出现以下错误。请指导我修复此错误 错误: ERROR TypeError: this._pdf is undefined Stack trace: ../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js/PdfViewerComponent.prototype.renderPage@http://localhost:4200/vendor.bundle.js:6275:9 .

我在angular 2应用程序中使用ng2 pdf viewer时出现以下错误。请指导我修复此错误

错误:

ERROR TypeError: this._pdf is undefined
Stack trace:
../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js/PdfViewerComponent.prototype.renderPage@http://localhost:4200/vendor.bundle.js:6275:9
../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js/PdfViewerComponent.prototype.render@http://localhost:4200/vendor.bundle.js:6251:13
../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js/PdfViewerComponent.prototype.onPageResize/this.resizeTimeout<@http://localhost:4200/vendor.bundle.js:6224:13
../../../../zone.js/dist/zone.js/</</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.bundle.js:2970:17
onInvokeTask@http://localhost:4200/vendor.bundle.js:114446:24
../../../../zone.js/dist/zone.js/</</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.bundle.js:2969:17
../../../../zone.js/dist/zone.js/</</Zone.prototype.runTask@http://localhost:4200/polyfills.bundle.js:2737:28
../../../../zone.js/dist/zone.js/</</ZoneTask.invokeTask@http://localhost:4200/polyfills.bundle.js:3044:24
ZoneTask/this.invoke@http://localhost:4200/polyfills.bundle.js:3033:28
timer@http://localhost:4200/polyfills.bundle.js:4441:17
<pdf-viewer [src]="pdfSrc" 
              [page]="page" 
              [original-size]="true" 
              style="display: block;"
  ></pdf-viewer>
import { Component, OnInit } from '@angular/core';

    @Component({
      selector: 'app-records',
      templateUrl: './records.component.html',
      styleUrls: ['./records.component.css']
    })
    export class RecordsComponent implements OnInit {

        pdfSrc: string = './pdf-test.pdf';
        page: number = 1;

      constructor() { }

      ngOnInit() {
      }

    }

这个问题已经解决了。我已经下载了所有的软件包,它得到了工作。但我无法找到上述问题的实际根源,因为问题已经解决。我已经下载了所有的软件包,它得到了工作。但我无法找到上述问题的真正根源