Closed shyamg91 closed 8 years ago
I'm getting the data for the csv through an api call and hence am using lazy load to ensure that the data is received. However it is getting triggered before.
<div type="button" ng-csv="getStudentData()" lazy-load="true" filename="test.csv" csv-header="studenttableHeader">EXPORT</div>
This is how my controller is set up :
$scope.getStudentData = function () { return lazyloadexport; }
edit : Exportstudents is a http get request which returns data .
function lazyloadexport() { var deferred = $q.defer(); Auth.exportStudents($scope.filterCode.filter).then(function (data) { $q.when(data).then(function () { deferred.resolve(data); }); }, function (err) { deferred.reject(err); }); return deferred.promise; }
This is what i understood was needed to make promises work. What am i doing wrong ?
Why was this closed? I have the same problem.
I'm getting the data for the csv through an api call and hence am using lazy load to ensure that the data is received. However it is getting triggered before.
This is how my controller is set up :
$scope.getStudentData = function () { return lazyloadexport; }
edit : Exportstudents is a http get request which returns data .
This is what i understood was needed to make promises work. What am i doing wrong ?