file reader plugin events are not firing
See original GitHub issueShort description of the problem:
while using file plugin with ionic-native found out that readAsArrayBuffer(path, file)
promise never resolves!
i did some digging and turns out it’s an fixed angular 2 zone issue and here is a detailed closed ionic issue about it. https://github.com/driftyco/ionic/issues/6020
it looks like it’s never been fixed for ionic 2
What behavior are you expecting?
file promises to be resolved
Steps to reproduce:
- setup a new project
- install camera and file plugin
- getpicture with camera and try to read it with readAsArrayBuffer
Camera.getPicture(options).then((imageData) => {
File.readAsArrayBuffer(imageData).then((res)=>{
//never resolves.
});
});
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc) https://github.com/angular/zone.js/issues/137 https://github.com/angular/angular/issues/2533
Which Ionic Version? 1.x or 2.x Cordova CLI: 6.0.0 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.0.0-beta.36 Ionic App Lib Version: 2.0.0-beta.19 OS: Windows 8.1 Node Version: v4.4.3
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
@jgw96 it seems a fix is found for this one in https://github.com/driftyco/ionic-native/issues/505#issuecomment-273504996
cordova.js
must be loaded afterpolyfills.js
in index.html
It will be best if this can be done in the Ionic starter projects, so it doesn’t happen to other users, as it’s very hard to debug and identify.
Thanks!
I agree , Its not fixed .
var reader = new FileReader(); reader.onloadend = (evt: any) => { }
onloaded never gets fired