Code licensed under New BSD License.
bower install ng-table-export
- Add possibility to specify encoding of the generated csv file. For example:
<a class="btn btn-primary" ng-mousedown="csv.generate($event)" ng-href="{{ csv.link() }}" download="test.csv">Export to CSV</a>
<table ng-href ... export-csv="csv" ng-export-encoding="latin1">
Alternatively (it's just a matter of taste):
<a class="btn btn-primary" ng-mousedown="csv.generate($event, 'latin1')" ng-href="{{ csv.link() }}" download="test.csv">Export to CSV</a>
<table ng-href ... export-csv="csv">
If you omit ng-export-encoding
, you will get the default (UTF-8
). Right now, only UTF-8 and latin1 (i.e. ISO-8859-1 is supported).
- In case you provide a short view in a table cell (e.g. using manual truncation of a string when it is too long) but still want
the original contents to be exported, then you can do so by setting the attribute data-fulltext on the
<td>
or<th>
element. If this attribute is present, its content is exported instead of the text() contents.