Hi I need to read a json file in angular using a service, using the http service
app.factory('Expenses', function($http){
var service = {};
service.entries = [];
$http.get('data/get_all.json').then(function (data){
service.entries = data;
//convertir fecha de string a objeto
service.entries.forEach(function(element){
element.date = myHelpers.stringToDateObj(element.date);
});
}).catch(function(data, status){
alert('error no se puede leer el archivo!');
});
I'm using angular 1.6.7 and change the file angular.min.js --- > angular 1.5.9 to make tests.
Help, do not read the file, send me the alert.
had success and change it by then, change error by catch