I want to inject a service created one module into a second totally different module, that depends on some data created by the first module. Let's say you import a feature module for authentication into your project and also a module to create a websocket. For authentication purpose you need an id saved in the local storage, that can be very easily accessed by the service from the authentication module, which has already been created. In the websocket module I provide an configuration in the forRoot
method, so the socket endpoint can be defined, as well as the already created authentication service instance from the authentication module.
Now my question is: how can I get this service instance and how can I inject it into my configuration for the websocket module?