asafdav/ng-csv — pull request #56 by SimeonC (2014-10-01 02:14:07+00:00)
Title: feat(ng-csv) Allow the ng-csv value to return a promise

Wraps the $scope.data() call in the buildCSV function so that we could optianally return an $http promise from the call with the data.
Also this adds/removes a class so the button could be styled for class loading. This defaults to 'ng-csv-loading' or can be modified via the ngCsvLoadingClass attribute.

My use case and example is (stripped down a lot):
```html
...
```
```coffeescript
$scope.csv.generate = ->
authHTTP.post '/api/timesheet', filters
.then (data) -> #this isn't required but I'm showing what I do to convert to proper data for an example
_csv = ((
name: row.name
start: Date.create(row.start).format Date.ISO8601_DATETIME
end: Date.create(row.finish).format Date.ISO8601_DATETIME
description: angular.element("

#{row.comment}

")[0].textContent ? ''
) for row in data)
_csv
```