I am encountering a strange issue with Angular 2 change detection when using a recursive function to read user drag & dropped files.
Refer to here for the example:
In the example above, there are two file drop areas. The top area uses a recursive function to read all files in user dropped items. The bottom area simply use dataTransfer.files
.
The files dropped is supposed to be displayed bellow. However, change detection only works for the bottom drop area.
This is a simplified version of my actual application. I am not keen to use ChangeDetectorRef
to trigger the detection (I know it will work for the plunker example).
Is there a better way to read all the files dropped in (including files in subfolders) with webkitGetAsEntry()
?
Or another way will work with Angular change detection?
I am on Angular 2.4.9.