I am creating a module comprised of several services. There is common functionality across these services. I wanted to adhere to DRY, so I created a "base" service and registered it in the module:
angular.module("ModuleA").service("BaseService", function () {...});
Then I can use that in my other services, like so:
angular.module("ModuleA").service("ChildService", function (BaseService) {...});
That works fine. However, I wanted the "base" service to be private/internal to this module. My app obviously depends on this module, and I don't want controllers etc. using the BaseService directly, which they can do since it is registered in ModuleA.
Is there a way to share the functionality in the BaseService class with several other services without exposing it to the entire application?
angular.module("ModuleA.Services.Subservice", ["ModuleA.Services"]).service("ChildService", ["BaseService", function(BaseService) { ... }]);)