0

I want to view a file with in the html page that exists on the server. I'm using angular 8.0.0 version. I have tried ngx-file-viewer. But it got an error called "Property 'wheelDelta' does not exist on type 'WheelEvent' ".

I have tried to solve that using event.deltaY instead of using event.wheelData which marked for the solution within the "How to fix " Property 'wheelDelta' does not exist on type 'WheelEvent' " while upgrading to angular 7,rxjs6?".

But after that it gets an error called " Cannot find name 'module'. Do you need to install type definitions for node? Try npm i @types/node and then add node to the types field in your tsconfig.".

can anyone tell me how to solve that?

After edit the code

         @HostListener('wheel', ['$event'])
           onWheel(event:MouseWheelEvent) {
           this.changeZoom(event.deltaY/2400);
           return false;
         }

1 Answers1

0

Extending my comment, for pdfs you could use the accepted answer from this question: [Recommended way to embed PDF in HTML?. I haven't used ngx-file-viewer but it is an experimental plugin. I wouldn't use it on production or frequently update code.

  • Is there any module to use for view any type of document files? – Thilini Hemarathna Jun 09 '19 at 09:08
  • Every answer I searched is by uploading the said files in google docs or officeapps and then loading them from there. Check this question https://stackoverflow.com/questions/27957766/how-do-i-render-a-word-document-doc-docx-in-the-browser-using-javascript – Giwrgos Lampadaridis Jun 09 '19 at 09:11
  • I refer that. But it gets an error "Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist." – Thilini Hemarathna Jun 09 '19 at 10:56