Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] - mapToValue need injectInto to add injector on value #227

Open
aliokan opened this issue May 12, 2017 · 4 comments
Open

[doc] - mapToValue need injectInto to add injector on value #227

aliokan opened this issue May 12, 2017 · 4 comments

Comments

@aliokan
Copy link
Contributor

aliokan commented May 12, 2017

In module :

var controller = new OneController();
_injector.mapToValue( IOneController, controller );
class OneController implements ICommandTrigger implements IOneController
{
	public function showDialog():Void
	{
		trace(this.injector) // this.injector == null 
	}
}
@FrancisBourre
Copy link
Collaborator

FrancisBourre commented May 12, 2017

You shoud inject into because its a value ;)

@aliokan
Copy link
Contributor Author

aliokan commented May 12, 2017

Should be documented !

var controller = new OneController();
_injector.mapToValue( IOneController, controller );
_injector.mapToValue( IOne2Controller, controller );

_addStatefulConfigs( [statefulConfig] );

_injector.injectInto( controller );

@aliokan aliokan changed the title injector == null in ICommandTrigger when its mapToValue [doc] - mapToValue need injectInto to add injector on value May 12, 2017
@FrancisBourre
Copy link
Collaborator

_addStatefulConfigs( [statefulConfig] );

var controller = _injector.instantiateUnmapped( OneController );
_injector.mapToValue( IOneController, controller );
_injector.mapToValue( IOne2Controller, controller );

Does this one work for you? It should be better...

@aliokan
Copy link
Contributor Author

aliokan commented May 12, 2017

Not in my case, because I need to inject controller in view defined statefulConfig

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

No branches or pull requests

2 participants