[go: up one dir, main page]

Injector namespace not recognized

When service from different injector is given as a constructor dependency (without Inject decorator), then it is not recognized.

This should work:

const controllersNamespace = Symbol('Controllers');
const controllersInjector = Container.for(controllersNamespace);

@Injectable()
class SomeService {}

@Injectable(controllersInjector)
class SomeController {
  constructor(public service: SomeService) {}
}

const controller = controllersInjector.provide(SomeController);

ok(controller.service instanceof SomeService);