-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Description
Container should be available for injections into members it contains (service locator anti pattern). Auto register container within itself when instantiating.
-
Write tests first, every member of a container should be able to inject container they're inside of.
class B { constructor(@Inject(TContainer) private container: IContainer) {} } -
create container type TContainer = Symbol('IContainer')` next to IContainer in the same file.
-
when instantiating a new container, that container instance should register itself within itself via TContainer type (
this.register({ token: TContainer, useValue: this }) -
Create an example file for typescript and javascript.