container-ioc
container-ioc copied to clipboard
[Feature][Design][Discussion] Modules
I've been thinking about creating additional api for maintaining hierarchical containers through Modules. The philosophy is similar to the ones used in angular and Nest.js.
Motivation. Encapsulating related services and other components into modules. Example:
...
@Module({
components: [
NavigationComponent,
SomeService,
SomeManager
],
exports: [
NavigationComponent
]
})
export class NavigationModule {
}
@Module({
import: [
HttpModule,
ApiModule,
NavigationModule
],
components: [
AppComponent
],
bootstrap: [
AppComponent
]
})
export class AppModule {
}
Isn't this (functionality wise) the same as using child containers/scopes? Would the decorator be a wrapper over creating a child container?