container-ioc icon indicating copy to clipboard operation
container-ioc copied to clipboard

[Feature][Design][Discussion] Modules

Open basedalexander opened this issue 7 years ago • 1 comments

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 {
    
}

basedalexander avatar Dec 02 '17 19:12 basedalexander

Isn't this (functionality wise) the same as using child containers/scopes? Would the decorator be a wrapper over creating a child container?

andrei-tatar avatar Dec 06 '18 12:12 andrei-tatar