ngx-file-drop
ngx-file-drop copied to clipboard
Dropping files prevents ApplicationRef.isStable
As soon as a file is dropped (or selected via the file selector), ApplicationRef.isStable is always false.
I'm guessing it has something to do with the timer you are using: https://github.com/georgipeltekov/ngx-file-drop/blob/8609873dc0c0ad39f208d5a72c4570b10b39b396/src/lib/ngx-drop/file-drop.component.ts#L197
See: https://angular.io/api/core/ApplicationRef#is-stable-examples
@georgipeltekov I can fix this issue using this approach. Is PR welcome?
@maxkuzmin sure, be my guest :)
@georgipeltekov actually, it seems like the issue is not angular zone related. I have revealed that after dragging file/files to drop zone timer(200, 200)
starts looping, but never stops. Is there any way to stop it without significant code changing? For example, can we stop it after emitting value? Or can single timer stream emit more then one array of files (seems like no, another array will be emitted by new timer stream, created by new checkFiles
call)
I'm late to the party, but this is expected behavior of ApplicationRef.isStable
. When there is any open Observable in your application, it will never be considered as stable, see the docs. Whatever you are trying to do, you should not rely on ApplicationRef.isStable
. Maybe ApplicationInitStatus.donePromise
is a good alternative for you.