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

Register collection of providers #198

Open
abratko opened this issue May 20, 2022 · 0 comments
Open

Register collection of providers #198

abratko opened this issue May 20, 2022 · 0 comments

Comments

@abratko
Copy link

abratko commented May 20, 2022

I have collection of config params. I want register it in container to inject into my services as init settings.

Some of params depends of request context on ssr. In this case I create child container and register them in child container.

I have to write many code to do these actions, beacouse container.register method does not take collection of providers, although @registry does this action.

It will be cool if i can create container and child container with initial collection of providers. For example

createContainer([
  { token: '%param_1%, useValue: 'value_1' },
  { token: '%param_2%, useValue: 'value_2' }
])
.createChildContainer([
  { token: '%param_1%, useValue: 'new_value_1' },
  { token: '%param_3%, useValue: 'value_3' }
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants