exportieren Okay, so zieht KeyResource Daten von meinem C# -Controller als eine Liste von durch Komma getrennten Werten. Wenn die Schaltfläche geklickt wird, protokolliert die Konsole diese Daten, aber wenn ich die alasql-Abfrage auf keyResource oder auf Daten einstelle, heißt es, dass die Datenquelle 0 nicht definiert ist.Alasql, wie Daten in CSV
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 ?', []);
});
};
});
Dies ist, was zur Zeit habe ich^
Diese sind, was ich versucht habe:
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]);
});
};
});
Ich bin nicht sicher, wie dies zu tun, denn wenn die Konsole die Daten protokolliert, Ich weiß nicht, warum es nicht funktioniert, wenn ich nach CSV exportiere?
welche Datenstruktur ist Ihr 'data' zu exportieren? Wie sieht es aus, wenn Sie an der Konsole loggen –
Es ist eine Zeichenfolge in der Konsole –