throws undefined error
This commit is contained in:
parent
160220ce4e
commit
81e0498e48
@ -418,7 +418,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
}
|
||||
}
|
||||
|
||||
private _loadDocument() {
|
||||
public _loadDocument() {
|
||||
if (this.fileData) {
|
||||
this.instance.loadDocument(this.fileData, {
|
||||
filename: this.fileStatus ? this.fileStatus.filename : 'document.pdf'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, HostListener, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute, Event, NavigationEnd, Router } from '@angular/router';
|
||||
import { AppStateService } from '../../../../state/app-state.service';
|
||||
import { WebViewerInstance } from '@pdftron/webviewer';
|
||||
import { PdfViewerComponent } from '../../components/pdf-viewer/pdf-viewer.component';
|
||||
@ -191,6 +191,15 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._router.events.subscribe((event: Event) => {
|
||||
if (event instanceof NavigationEnd) {
|
||||
console.log(event);
|
||||
if (!event.url.includes('?page=') && event.url.includes('/ui/projects/') && event.url.includes('/file/')) {
|
||||
this._viewerComponent._loadDocument();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user