Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Factory name for injecting into StateManagers in an initializer? #16

Open
atduskgreg opened this issue Feb 21, 2015 · 3 comments
Open
Labels

Comments

@atduskgreg
Copy link

Hi,

I'm trying to use application.inject() in an initializer in order to make an object available to my StateManager and I was wondering what the correct name for the factory of StateManagers is in order to do this?

For example, here I register my PassManager object and inject it into my application's controllers:

application.register('service:pass_manager', PassManager);
application.inject('controller', 'passManager', 'service:pass_manager');

This works correctly. But now I want to also inject this same PassManager object into the StateManager subclasses I'm using in my application. I tried:

application.inject('stateManager', 'passManager', 'service:passManager');

without any luck. Is it possible to inject into StateManager in this way?

(Note: It happens that the object I'm trying to inject is also a StateManager subclass, but that doesn't seem to me like it would be a problem other than needing to scope this inject statement to not be circular, for example by changing the first argument to: 'stateManager:MyOtherSMSubclass' rather than simply 'stateManager' or whatever the correct factory name is.)

@stefanpenner
Copy link
Member

statemanager is lagging behind conventions needed to support this nicely.

@atduskgreg
Copy link
Author

@stefanpenner What would need to be done? Are there docs or anything you can point me to so I could scope out if this was something I could possibly contribute?

@stefanpenner
Copy link
Member

It would need to resolve states rather then direct references. I don't believe such docs exists. But they really should

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants