One of the challenges I'm facing is with an http service that retrieves external json files and populates a grid.
The issue arises when I attempt to use this http service in different controllers. I need to create a custom http service that can be utilized across various controllers while maintaining the same functionality (fetching external Json file).
$http.get('../JSON/permanentEmployees.json').
success(function(data, status, headers, config) {
$scope.masterArray = data;
}).
error(function(data, status, headers, config) {
$scope.errorMessage = "Requested grid data file does not exist";
});
This is my current setup for the http service. Any suggestions on how to improve this would be highly appreciated. Please keep in mind to use only AngularJS.