I don't understand what's the difference between module dependency and service dependency. For example,
angular.module('components.users', [])
.controller('UsersController', function(Users) {
//...
})
angular.module('api.users', [])
.factory('Users', function() {
//...
});
I don't understand why Users service could be passed in in controller method of components.users as no module is required by component.users module. (I thought api.users module should be passed in in the module method as one of required modules).
In other words...
What is difference between module dependency and service dependency?
Why a service is available even when the module it is defined is not required?
You may check if you're using an existing code base from your team that they have defined a root or base 'app' module that includes your defined 'Users' service. Below is an example of how this may be working in your project and why you're able to use the 'Users' service: