You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
I am using angular 4.3 (and zone 0.8.12) and I am experiencing some troubles with the official cordova file plugin. The plugin has a patched version of the FileReader class that does not implement the EventTarget interface. If I understand well what it is done by zone.js to "onProperties" (onload,onerror...) is that they are converted to there zone-ready addEventListener(...) counterpart, so my onerror,onload callback never got trigerred...
I understand that it is a plague to implement all singularity of any library, so maybe there should be a more-generic method like zone.runUnpatched(()=>{}) to get the "original"/unpatched constructor of patched API.
suggestion:
For now, if I run this:
zone.run(()=>{letreader=newFileReader();});
new FileReader() it will call zone's delegated constructor that will transform onProperties to addEventListener. reader being a zone-patched instance of FileReader.
Implementing a method like zone.runUnpatched(()=>{}) that will call the actual non-patched constructor would solve that kind of problem :
I guess I can but it will only work on mobile device (not browser) and sounds like a pain in the a** to create. If I just mock cordova's FileReader patch is that okay for you (I just need to create a FileReader that does not implement EventTarget) ?
I am using angular 4.3 (and zone 0.8.12) and I am experiencing some troubles with the official cordova file plugin. The plugin has a patched version of the
FileReader
class that does not implement theEventTarget
interface. If I understand well what it is done by zone.js to "onProperties" (onload
,onerror
...) is that they are converted to there zone-readyaddEventListener(...)
counterpart, so myonerror
,onload
callback never got trigerred...I understand that it is a plague to implement all singularity of any library, so maybe there should be a more-generic method like
zone.runUnpatched(()=>{})
to get the "original"/unpatched constructor of patched API.suggestion:
For now, if I run this:
new FileReader()
it will call zone's delegated constructor that will transform onProperties toaddEventListener
.reader
being a zone-patched instance ofFileReader
.Implementing a method like
zone.runUnpatched(()=>{})
that will call the actual non-patched constructor would solve that kind of problem :The text was updated successfully, but these errors were encountered: