I hacked a bit on your code and made changes that may be usefull for outhers too, but it breaks compatibility in some cases.
23dcabd just resolves issue #11
The other changesets move the registration map from modules to the Injector. It makes unregistration at runtime possible and allows registration without subclassing a module. Example:
var injector = new Injector();
injector
..register(MyClass).toType(MySpecialClass)
..register(YourClass)
..register(MyClass, 'test').toType(MySpecialClass);
var myClass = injector.getInstance(MyClass);
var yourClass = injector.getInstance(YourClass);
injector.unregister(MyClass);
injector.unregister(YourClass);
var myNamedClass = injector.getInstance(MyClass, 'test');
Hi,
I hacked a bit on your code and made changes that may be usefull for outhers too, but it breaks compatibility in some cases.
23dcabd just resolves issue #11
The other changesets move the registration map from modules to the Injector. It makes unregistration at runtime possible and allows registration without subclassing a module. Example: