javiertelioz / angular2-csv

Helper library for create CSV file in Angular 2
MIT License
64 stars 88 forks source link

Returns only new lines #64

Open iDomas opened 6 years ago

iDomas commented 6 years ago

Data format I use:

[
    {
        firstColumn: "column1"
        secondColumn: "column2"
        thirdColumn: "column3"
        fourthColumn: "column4"
    }
]

Code I use to generate csv: new Angular2Csv(exportData, 'report')

Here is object of Angular2csv in console:

Angular2Csv {csv: ↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵", 
data: Array(37), _options: {…}}
csv:"↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵↵"
data:(37) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
_options:
{filename: "report", fieldSeparator: ",", quoteStrings: """, decimalseparator: ".", showLabels: false, …}

P.S. If I use headers, then headers are written to csv, but data is not.

javiertelioz commented 6 years ago

Hello

I have already released a new version, I hope to correct these problems, change the way to use and install, I hope it is not an inconvenience to use this library, I will continue to add new features.

regards

iDomas commented 6 years ago

Now I get error: node_modules/angular2-csv/Angular2-csv"' has no exported member 'Angular2Csv'. P.S. Im using Angular 6

gcampa commented 6 years ago

got the same error here: node_modules/angular2-csv/angular2-csv"' has no exported member 'Angular2Csv' angular 4.3.6

jamiehankins commented 6 years ago

Javier, your readme only shows using your component as part of a template. Can we still use it by calling it like this? new Angular2Csv(this.rowData, 'EventLog', options); When I look at your readme, I only see the options and data in the component, and the calling is only done in the template, which is not what we want. When I look through the source in my node_modules, I don't see a Angular2Csv object, which would be why we see the error "...node_modules/angular2-csv/angular2-csv"' has no exported member 'Angular2Csv'.

Thanks, Jamie