InversifyJS icon indicating copy to clipboard operation
InversifyJS copied to clipboard

how can we group different provides into separated modules in inversify-binding-decorators?

Open tlyau62 opened this issue 4 years ago • 1 comments

I got 3 classes, and I would like to have (ServiceA) as a group, and (ServiceB, ServiceBChild) as another group. Such that, there are 2 modules can be provided.

Expected Behavior

@provide("ServiceA")
class ServiceA {
}

@provide("ServiceB1")
class ServiceB1 {
}

@provide("ServiceB2")
class ServiceB2 {
}

// ...

const container = new Container();

container.load(moduleA); // moduleA contains ServiceA only.
container.load(moduleB); // moduleB container ServiceB1 and serviceB2

tlyau62 avatar Sep 07 '21 03:09 tlyau62

maybe you need see: container_modules

AEPKILL avatar Sep 24 '21 03:09 AEPKILL