I've been working on an angular seed project that includes services and a factory. Specifically, my companyService
relies on a factory named company. However, I've encountered an issue when trying to inject company into companyService
, resulting in this error. I'm struggling to identify my mistake.
var module = angular.module('project.services', []);
module.factory('company', ['$rootScope', 'Resource', function($rootScope, $resource){
return $resource($rootScope.api + 'companies/:id');
}]);
module.service('companyService',['$rootScope', '$http', 'company', function($rootScope, $http, company){
var companies;
//var $injector = angular.injector();
//var company = $injector.get('company');
// additional functions ....
}]);