You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have code that runs in a pipeline and I want to use injection to provide an instance of 1 class for local dev, another for unit tests and the "real" one for production.
Create the injector: jovo.$injector = createInjector();
In code that only runs during dev, provide the class jovo.$injector.provideClass('myService', ServiceDev);
ServiceDev class implements ServiceInterface. Other classes ServiceTest, ServiceProd.
Get an instance of the class and assign to interface: const myService = jovo.$injector.injectClass('myService')
Currently ServiceDev has no ctor params to inject. Other classes will.
The text was updated successfully, but these errors were encountered:
I have code that runs in a pipeline and I want to use injection to provide an instance of 1 class for local dev, another for unit tests and the "real" one for production.
jovo.$injector = createInjector();
jovo.$injector.provideClass('myService', ServiceDev);
const myService = jovo.$injector.injectClass('myService')
The text was updated successfully, but these errors were encountered: