I recently added a service to my app which has caused it to throw an error. The code runs fine when its not minified. When minified, however, it throws an error. Here is the abbreviated code:
var service1 = function ($resource) { // code here }; service1.$inject = ['$resource']; var service2 = function (service1) { // code here }; service2.$inject = ['service1']; var service3 = function ($q, service2) { // code here }; service3.$inject = ['$q', 'service2']; Here is the error I receive when I run the code minified:
Error: [$injector:unpr] Unknown provider: nProvider <- n <- service1 <- service2 <- service3 I am injecting all the required dependencies here so this error is very confusing. I feel like the fact that service2 is a dependency to service3 but also has a dependency on service1 is the root of the problem. This should be legal, correct?