Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Cordova File Plugin should be patched, or there should be a way to unpatch things on runtime. #868

@n00dl3

Description

@n00dl3

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(()=>{
  let reader = new FileReader();
});

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 :

zone.runUnpatched(()=>{
  let reader = new FileReader();
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions