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
Hierarchical injector #59
Comments
@AurelieV try: @Module({
modules: [ UserModule ],
controllers: [],
components: [ AuthenticationService ],
exports: [
AuthenticationService
]
})
class AuthenticationModule {} as it's described here: https://kamilmysliwiec.gitbooks.io/nest/content/advanced/shared-module.html |
The problem is I do not want my two modules being dependant on each others. |
An other example will be to inject Configuration class, and re-use your modules accross different applications. You inject the app-specific configuration on app module decorator, you import the different modules and everything will be working for this app. |
Hi @AurelieV, |
Yep. |
Hi @AurelieV, |
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. |
Hi,
in order to make more reusable code, I would like to create a module which use a component which is not a part of this module, nor include in an imported module. The component will be inject by the ApplicationModule (main module). It seems that this is not supported?
Example:
AuthenticationModule has different controllers which use a UserService dependency.
UserModule also has different controllers which use a UserService dependency.
Depending on application, the UserService may be implemented in different way. What I want is defining this in the ApplicationModule for all modules, once for all.
I was expecting below code to work (similar to angular), but the userService dependency is not found.
The text was updated successfully, but these errors were encountered: