You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using these attributes: ng-csv="csv.generate()" quote-strings="true" lazy-load="true" csv-header="csv.header()" filename="timesheet.csv" it seems that the csv-header and filename attributes are being ignored.
I think the issues are here: L41return $scope.filename || 'download.csv'; The scope isn't getting the value, as you aren't actually watching the value it's probably better to use $attrs.filename instead of $scope.filename and I think they dropped the '@' scope declaration at some point in angular 1.2 which is probably why it isn't working for me.
The other issue is here: L49if (angular.isDefined($attrs.csvHeader)) options.header = $scope.$eval($scope.header);. I think you meant to do $scope.$parent.$eval($scope.header) as your scope option in the directive is creating a child scope.
I've found that optional attributes are generally better off not putting on the scope option of the directive and just checking for their existence via $attr.
Thanks for the module, apart from those it's worked great for me.
The text was updated successfully, but these errors were encountered:
Using these attributes:
ng-csv="csv.generate()" quote-strings="true" lazy-load="true" csv-header="csv.header()" filename="timesheet.csv"
it seems that thecsv-header
andfilename
attributes are being ignored.I think the issues are here: L41
return $scope.filename || 'download.csv';
The scope isn't getting the value, as you aren't actually watching the value it's probably better to use$attrs.filename
instead of$scope.filename
and I think they dropped the '@' scope declaration at some point in angular 1.2 which is probably why it isn't working for me.The other issue is here: L49
if (angular.isDefined($attrs.csvHeader)) options.header = $scope.$eval($scope.header);
. I think you meant to do$scope.$parent.$eval($scope.header)
as your scope option in the directive is creating a child scope.I've found that optional attributes are generally better off not putting on the scope option of the directive and just checking for their existence via $attr.
Thanks for the module, apart from those it's worked great for me.
The text was updated successfully, but these errors were encountered: