redstone-dart / redstone

A metadata driven microframework for Dart.
http://redstone-dart.github.io/redstone
MIT License
342 stars 42 forks source link

Is there a way to get the ModuleInjector created by redstone.dart? #109

Closed Pacane closed 9 years ago

Pacane commented 9 years ago

I'm trying to use the same instance of a class injected in my Group but outside of redstone.dart.

See this for the whole explanation: http://stackoverflow.com/questions/29590217/singleton-in-di-dart

I can see that one is created by _ManagerImpl that is private. Or better, is there a way to have redstone use an external injector? I'd like to pass him mine or create a child of mine..

azenla commented 9 years ago

I'll look into it.

Pacane commented 9 years ago

I think as @zoechi as pointed out on StackOverflow that a plugin could do this, since we get access to the manager, we could at least provide a setter there to I could use redstone's injector in my app? What do you think?

azenla commented 9 years ago

@Pacane I think yes. I'll add this.

Pacane commented 9 years ago

@kaendfinger Just so you know, this is how I'm working around it right now. http://stackoverflow.com/a/29592194/505810