abelalvarez89 / xlsx-parse-json

MIT License
13 stars 4 forks source link

What does "vm" refers to in your js example snippet? #1

Closed prameshbajra closed 6 years ago

prameshbajra commented 6 years ago

In your readme example, what does VM object refers to? Also, How do we instantiate it?

abelalvarez89 commented 6 years ago

'vm' stands for view model, that is just a variable for the scoped of the component. That example was using AngularJs. You can use any library you want such as (AngularJs, Angular, React or any other that uses javascript), the code for parsing is

'use strict'; var xlsxParser = require('xlsx-parse-json');

function uploadFile(file) {

var data = xlsxParser.onFileSelection(file);
console.log(data); //output xls json data

}

In your code you just need to call uploadFile(file)

prameshbajra commented 6 years ago

Ok, doubt cleared. Thanks.