Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with Container instance #73

Open
fabiocavalcantezup opened this issue Aug 28, 2020 · 1 comment
Open

Help with Container instance #73

fabiocavalcantezup opened this issue Aug 28, 2020 · 1 comment

Comments

@fabiocavalcantezup
Copy link

fabiocavalcantezup commented Aug 28, 2020

Hi,

Can someone help me to solve a problem. Im using typescript-ioc in 2 modules and module B dependes on module A. The problem is, somehow the Container instance used in each library seems to be different (which makes sense).

My question is, there anyway to share Container instance between two libraries?

Thanks in advance

Edit: I already solved by exporting the instance of Container from A to B, but it seems that i should have not do this.

@Kampfmoehre
Copy link

You must use the same typescript-ioc instance across libraries. In module A don't install typescript-ioc directly but via peer-dependencies and let module B instasll typescript-ioc. This way the same "instance" of Container is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants