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

[Request] Implementation of "useExisting" provider #2145

Closed
jbjhjm opened this issue May 6, 2019 · 3 comments
Closed

[Request] Implementation of "useExisting" provider #2145

jbjhjm opened this issue May 6, 2019 · 3 comments

Comments

@jbjhjm
Copy link

jbjhjm commented May 6, 2019

Feature Request

I need to provide a service both directly and via a provider token.
Both need to inject the same instance.
For this use case, angular implements a ExistingProvider.

Currently this is only possible by implementing a manual singleton pattern through a factory function.

It would be awesome to see the ExistingProvider in nestjs too and would further reduce differences to angular.

Thanks.

@kamilmysliwiec
Copy link
Member

Published as 6.3.0

@jbjhjm
Copy link
Author

jbjhjm commented Jun 13, 2019

Works perfectly fine. Thank you Kamil!!

@lock
Copy link

lock bot commented Sep 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants