Open leptoquark1 opened 3 years ago
Hey there,
thanks for your feedback. I think the cleaner way would be to use OnPush change detection within the library as well. I am planning to re-implement the package and add some new functionality during the next weeks anyway, so I will keep this in mind.
Happy coding! 🤓
Hi @peterfreeman
Can I ask if what is the status of this issue? I'm having the same issue in which my component uses OnPush change detection
Thanks for this library. Really helpful.
Hi @gitalvininfo,
I am still working on the update in the background, so it will still take a while. I am sorry for your inconveniences but hopefully you can work around them.
Happy coding! 🤓
@peterfreeman
No problem! I already made a workaround by removing the changeDection.OnPush 😂. I decided not to care. Modern problem requires modern solution they say.
Thanks again for this library, it helped improve my UX in my app.
I've the issue that the changes of any input to the preview components have no visible affect when the ChangeDetection strategy of the wrapping component is
OnPush
.I can call ChangeDetectorRef.markForCheck only guessing when the preview component is ready
Since the readFile method is async:
https://github.com/peterfreeman/ngx-dropzone/blob/c255e75d140346490fe822a63aef77218825d3e1/projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-preview.component.ts#L93
you'll need either emit an event when
renderImage
Method:https://github.com/peterfreeman/ngx-dropzone/blob/c255e75d140346490fe822a63aef77218825d3e1/projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-image-preview/ngx-dropzone-image-preview.component.ts#L45
is ready and the view value is updated or the library should switch to OnPush Strategy as well.
@peterfreeman What do you think?