Sorry for posting here but I was unable to get a response to this question on Glitter.
I'm using container.registerInstance('MyApiClient', new MyApiClient('url-not-known-until-runtime')); in main.configure to register a global singleton which my view models can share. I'm able to inject this in my viewmodels but its constructed with no parameters, not the one registered. I've tried using both @autoinject and @inject(MyApiClient) annotations.
In short, I'm simply after a way to create a singleton instance of an object at boot time and share it across my components, how do I do this? FYI I'm using TypeScript.
Sorry for posting here but I was unable to get a response to this question on Glitter.
I'm using container.registerInstance('MyApiClient', new MyApiClient('url-not-known-until-runtime')); in main.configure to register a global singleton which my view models can share. I'm able to inject this in my viewmodels but its constructed with no parameters, not the one registered. I've tried using both @autoinject and @inject(MyApiClient) annotations.
In short, I'm simply after a way to create a singleton instance of an object at boot time and share it across my components, how do I do this? FYI I'm using TypeScript.