I am looking to retrieve an array from another service file (chart-serv.js) in my return-serv.js service file using AngularJS. How can I reference the dependent file enclosed within double braces [ ], in line 1?
return-serv.js
var app = angular.module('starter.return-serv', ['starter.chart-serv'])
app.factory("ReturnData", function() {
return {
allData: function() {
var data = starter.chart - serv.chartPricesUpTo6Hours;
return data
}
}
});
chart-serv.js
var app = angular.module('starter.chart-serv', [])
var chartPricesUpTo6Hours = {
"10": {
"1": 95,
"2": 125,
"3": 155,
"4": 185,
"5": 215,
"6": 245
},
"20": {
"1": 105,
"2": 135,
"3": 165,
"4": 195,
"5": 225,
"6": 255
}
};
I am unsure about how to access the other file within the data variable of the allData function. What should be called to access it?