Lets say I have UserService
. I have another module that depends on abstract PersonService
. How can I substitute my own UserService
to the PersonService
?
So, I want some link UserService (container name of service) to the PersonService (container name of service). How do I do that?
what do I call abstract service?
Lets say I have PhotoModule. PhotoModule is only about PHOTOS. But PhotoModule also needs some user functionality.
Lets say I have UserModule. UserModule is only about users; it does not know anything about photos and PhotoModule.
How do we resolve this dependencies without mixing them?
Lets say PhotoModule has abstract service PersonService. Yes, there is no abstract service in angular, but I name it so because it does not have function implementation - only service name. PhotoModule needs, for example PersonService.getCurrentUser()
.
Such as PersonService.getCurrentUser
does not have implementation body, but UserService.getCurrentUser
have (from UserModule), I want to substitute PersonService with UserService.
But still, PhotoModule does now know about UserService, but knows about PersonService. My point is to substitute PersonService with UserService on the application configuration level to resolve this dependencies.