intbot / ng2-pdfjs-viewer

An angular component for PDFJS and ViewerJS (Supports all versions of angular)
Apache License 2.0
225 stars 113 forks source link

Triggering several change detection after pdfjs load #216

Open cgcdoss opened 1 year ago

cgcdoss commented 1 year ago

As soon as the ng2-pdfjs-viewer component is loaded it triggers several change detections. And even when he is destroyed these trigger continue. Affecting application performance. Using Angular Devtools I was able to notice this inconsistency:

ng2-pdfjs-viewer change detection trigger

As you can see in the GIF above, the shots occur and they never end. Even after the component has been destroyed.

Versions

Angular CLI: 14.2.6 Node: 16.18.0 Package Manager: npm 8.19.2 OS: win32 x64

Angular: 14.2.7 ... animations, common, compiler, compiler-cli, core, forms ... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1402.6 @angular-devkit/build-angular 14.2.6 @angular-devkit/core 14.2.6 @angular-devkit/schematics 14.2.6 @angular/cli 14.2.6 @schematics/angular 14.2.6 rxjs 7.5.7 typescript 4.8.4 ng2-pdfjs-viewer 14.0.0

cgcdoss commented 1 year ago

Using the SampleApp present in this repository the problem also occurred.