I want to create a module that would be hosted in the root module, and each other module might, or might not, register some options for it - the goal is to not reference those module from the original, and have it dynamically discover such list of options.
Something like:
@Module({
providers: [
{
provide: "AMQP_FEATURE_OPTIONS",
useValue: "<some partial AMQP options needed only for A to run>"
}
]
})
class FeatureA {}
@Module({
providers: [
{
provide: "AMQP_FEATURE_OPTIONS",
useValue: "<some partial AMQP options needed only for B to run>"
}
]
})
class FeatureB {}
@Module({
imports: [
AMQP.forRoot("<some root AMQP options>"),
FeatureA,
FeatureB,
]
})
class AppModule {}