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.
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')