Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set labels #50

Open
hpknight opened this issue Mar 16, 2018 · 1 comment
Open

How to set labels #50

hpknight opened this issue Mar 16, 2018 · 1 comment

Comments

@hpknight
Copy link

When using this tool, data is exporting just fine. I want to show labels of what each column represents. I see in the documentation that I can set showLabels:true in the options. This did not work for me. How do I set labels?

@animatedantmo
Copy link

animatedantmo commented Mar 20, 2018

I had the same issue since the documentation is spotty on this. But from looking at the implementation it seems we have to add a property named 'headers' which is an array filled with the header column names. At least this is what I ended up doing to get it working. Not sure if this is intentional or not.

const options = { 
      headers: [
        'Header1',
        'Header2',
        'Header3'
      ]
    };

new Angular2Csv(data, 'My Report', options);

Edit: It looks like this is already being discussed here #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants