asafdav/ng-csv

How to add more than one header?

Opened this issue · 2 comments

Please refer attachment.

2Headers.xlsx

Its easy
HTML

button type="button" ng-csv="exportArray()" filename="Reports_CSV.csv" csv-main="headerFirstExport" csv-header="headerExport">export</button

Javascript

$scope.exportArray = function () {   
    return $scope.data;
}  $scope.headerFirstExport=['CSV-header 1 -   Column A','CSV-header 1- Column B','CSV-header 1 - Column C']; 
$scope.headerExport = ['CSV-header 2 -   Column A','CSV-header 2 - Column B','CSV-header 2 - Column C'];

Library for ng-csv is attached below

ng-csv.txt

@dekhosla Hi I am trying to add two headers too.
But csv-main does not seem to work for me.