In angularjs I created some service
that loads JSON object:
// used to load table from json file instead ajax
myModule.factory('Items', ['$http', function($http){
var Url = "src/utils/some.json";
var Items = $http.get(Url).then(function(response){
return response.data;
});
return Items;
}]);
And in controller I can call it like:
Items.then(function(data){
$scope.items = data;
});
As You can see I load some.json
file.
What should be flow to do the same with CSV
file?
in my case $scope.items
is a list of objects.
Does someone know how to get CSV data by using $http.get
or other way?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…