ng-csv icon indicating copy to clipboard operation
ng-csv copied to clipboard

cannot use Promise to retrieve header

Open ORESoftware opened this issue 8 years ago • 1 comments

I can use a promise to retrieve the rows for the csv file, but I cannot seem to use a promise to retrieve the header, e.g.:

     <button 
        type="button" ng-csv="getArray(acquisition)"
       csv-header="getCSVExportFileHeader()"
       filename="cdt-export-{{acquisition.companyName}}.csv">

     $scope.getCSVExportFileHeader = function(){
          return HomeService.getCSVHeader(); // returns a promise
       };

I don't think this library can handle a promise here - of course, there is a race condition if the header returns after the array, but I think the users of the library can handle this race condition :)

So my request is for you to support a promise to retrieve the header, thanks!

ORESoftware avatar Mar 10 '17 01:03 ORESoftware

@ORESoftware - I am unable to retrieve promise data in the csv file. can you please share scope method which returns the promise for data.

yusuf9982 avatar Apr 30 '18 09:04 yusuf9982