In order to set the base of my url in a factory call I need to call another factory's method to get the config. The below keeps throwing a Provider 'reportService' must return a value from $get factory method. error:
.factory('reportService', ['$resource', 'serverService',
function($resource, serverService) {
serverService.getConfiguration().$promise.then(function(config) {
var base = config.reporting.url;
return $resource(base, {}, {
getReportResults: {method: 'POST', url: base + '/api/reports/:id/versions/:version'}
});
});
}])
serverService:
angular.module('app')
.factory('serverService', ['$resource',
function($resource) {
var base = '/api/server/';
return $resource(base, {}, {
getConfiguration: {method: 'GET', url: base + 'configuration'}
});
}]);