Okay, so keyResource pulls data from my C# controller as a List of comma separated values. When the button is clicked, the console does log this data but when I set the alasql query to keyResource or to data it says datasource 0 is undefined.
angular.module("umbraco")
.controller("ExportAllController", function($scope, $http, keyResource){
$scope.exportAll = function ($scope) {
keyResource.exportAll().then(function (data) {
console.log(data);
alasql('SELECT * INTO CSV("AllDictionaryItems.csv",{headers:true}) FROM ?', []);
});
};
});
This is what I currently have ^
These are what I have tried:
angular.module("umbraco")
.controller("ExportAllController", function($scope, $http, keyResource){
$scope.exportAll = function ($scope) {
keyResource.exportAll().then(function (data) {
console.log(data);
alasql('SELECT * INTO CSV("AllDictionaryItems.csv",{headers:true}) FROM ?', [$scope.exportAll]);
});
};
});
angular.module("umbraco")
.controller("ExportAllController", function($scope, $http, keyResource){
$scope.exportAll = function ($scope) {
keyResource.exportAll().then(function (data) {
console.log(data);
alasql('SELECT * INTO CSV("AllDictionaryItems.csv",{headers:true}) FROM ?', [keyResource]);
});
};
});
angular.module("umbraco")
.controller("ExportAllController", function($scope, $http, keyResource){
$scope.exportAll = function ($scope) {
keyResource.exportAll().then(function (data) {
console.log(data);
alasql('SELECT * INTO CSV("AllDictionaryItems.csv",{headers:true}) FROM ?', [data]);
});
};
});
I'm not sure how to do this because when the console is logging the data, I don't know why it's not working when I'm exporting to CSV?