Passing params to Container.get() or Container.of()
See original GitHub issueIn the inline documentation, the Container.get() method says the following:
Retrieves the service with given name or type from the service container. Optionally, parameters can be passed in case if instance is initialized in the container for the first time.
Emphasis mine. It didn’t seem like this was accurate, as there was no overload that seemed to support this. I did a little research, and discovered that this feature did indeed exist at one point, but was removed seemingly without any communicated justification in this commit: https://github.com/typestack/typedi/pull/18/commits/79f3435f42502ee2410052c7e0391eb94fd689f0.
So I am here to ask- what was the justification? Is there a replacement for the use-cases this supported?
The main use-case I am looking for is for passing parameters to factories of transient instances, so I can configure them on a per-request basis.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (2 by maintainers)

Top Related StackOverflow Question
@pleerock any chance to get any insights from you on the topic? My workaround is not really a suitable alternative to just passing parameters to
Container.get().Having the exact same question as @weoreference. Taking a look at the code it seems like its not currently possible to pass parameters to the constructor. I tried with
registerHandlerbut without luck.