Error when creating angular library with a service
Budget: $10 – $20 AUD
Hi, I'm creating an angular library for reuse common code I have in angular projects but I'm getting a problem while trying to create a service with an external module (for example HttpClient), when I try to inject it through the constructor I get the following error:
NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with `EnvironmentInjector#runInContext`.
The project will consist on helping me get out of this stuck by showing me the correct way to do it.
NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with `EnvironmentInjector#runInContext`.
The project will consist on helping me get out of this stuck by showing me the correct way to do it.