helvio88 / angular-xlsx-model Goto Github PK
View Code? Open in Web Editor NEWAngular model to convert XLSX files into JSON directly into the model
Angular model to convert XLSX files into JSON directly into the model
Uncaught ReferenceError: XLSX is not defined
at FileReader.reader.onload (xlsx-model.js:68)
I figured out how to solve Internet Explorer compability issue.
You have to add following script for extend FileReader.readAsBinaryString function to head of your html page.
if (FileReader.prototype.readAsBinaryString === undefined) { FileReader.prototype.readAsBinaryString = function (fileData) { var binary = ""; var pt = this; var reader = new FileReader(); reader.onload = function (e) { var bytes = new Uint8Array(reader.result); var length = bytes.byteLength; for (var i = 0; i < length; i++) { binary += String.fromCharCode(bytes[i]); } pt.content = binary; $(pt).trigger('onload'); } reader.readAsArrayBuffer(fileData); } }
After that in xlsx-model.js file; you should add the following lines after onload functions.
if (!file) { var data1 = reader.content; } else { var data1 = file.target.result; }
I combined it with the information on this page.
It gave a successful result.
You get an error on xlsx-model.js line 86: Object doesn't support property or method 'readAsBinaryString'
I then tried this workaround: http://stackoverflow.com/a/32665193/1324921
And I got an error on line 67: Unable to get property 'target' of undefined or null reference
You can replicate this with the Plunker you listed on your repo.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.