Check out my small demonstration using a stackblitz, I'm having an issue.
In the setup, there's a master component with pan-zoom functionality containing a parent component with children content. The library in use is ngx-panzoom.
The default change detection strategy seems to be functioning well, however, in a real-life scenario, I had to manually call cdr.detectChanges()
at the end of ngAfterViewInit
.
In the stackblitz example, leaving the ChangeDetectionStrategy
as default appears to work. But when attempting manual change detection (using the private detectChanges
function), the set panZoomAPI
ends up being null or undefined rather than the actual API.
This leads to issues with the resetPanZoom
function which requires the API to calculate the width and center the content properly.
Any thoughts on why my api
is becoming undefined
upon triggering manual change detection?