Javascript 使用ng2 pdf查看器时出错
我在angular 2应用程序中使用ng2 pdf viewer时出现以下错误。请指导我修复此错误 错误: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 .
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() {
}
}
这个问题已经解决了。我已经下载了所有的软件包,它得到了工作。但我无法找到上述问题的实际根源,因为问题已经解决。我已经下载了所有的软件包,它得到了工作。但我无法找到上述问题的真正根源