I have an Angular project with 2 apps and 2 libs. I have build a service in one of the libs, because I want to use the service in both apps.
The problem is that I need the environment
from the environment.ts
in the service and the that both apps have different environments.
How can I can inject
the correct environment in the service?
You can create an InjectionToken:
Then use this token in your service that is used by both apps:
In the last step you provide a value for this token in both of apps:
App 1:
App 2: