Simple directive that turns arrays and objects into downloadable CSV files
-
Add ng-csv.min.js to your main file (index.html)
-
Set
ngCsv
as a dependency in your module
var myapp = angular.module('myapp', ['ngCsv'])
- Add ng-csv directive to the wanted element, example:
<button type="button" ng-csv="getArray()" filename="test.csv">Export</button>