Hello!
A question about dynamic modules.
I'm trying to make a dynamic module that has static methods forRoot, forRootAsync, forFeature
According to the documentation, options can be passed to forRoot that define the global configuration for the module. Then, using the same module in other modules, but with forFeature, you can override some options, while knowing about the global configuration that was set via forRoot.
The idea is this: there are three modules AModule, BModule, CModule.
AModule is the main one. It will be connected to AppModule with some global configuration (forRoot). It will also be connected to other modules, already with some options overridden (forFeature)
BModule will be connected to AModule and must know about the global configuration that was passed via forRoot, as well as the configuration for a specific module (forFeature), where AModule is connected. Options must be merged
CModule - will be connected to BModule and already merged options must be passed to it.
The problem is that I do not understand how to do this correctly.
When I tried to implement the plan on my own, I encountered the fact that the options passed via forFeature are picked up only from the first module that is connected to AppModule, and not as planned, each module has its own options