[n00bs] i just can't find example for service -> model
i follow 2-3 examples so far so good but i just can't find how to send vo data directly from service to model
it would be "05a" refer to this diagram http://www.robotlegs.org/diagram/
thanks
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Stray on 05 Nov, 2010 05:42 PM
Hi there,
no worries, just inject your model into your service and populate it direct.
Eg - in your context startup:
mapSingletonOf(ISomeModel, SomeModel);
and in your service
[Inject]
public var someModel:ISomeModel
then you can use the someModel variable directly in the service. Best to use an interface for your model so that you don't couple it together too tightly.
Hope that helps - ask more if you need to,
Stray
3 Posted by katopz on 06 Nov, 2010 12:23 PM
Hey Stray
thx for reply, it's working now :)
btw, this service -> model instruction should be write in docs somewhere?
just curious that maybe i skip reading it...
thanks!
4 Posted by Thomas Gillis on 17 Nov, 2010 01:22 PM
Hello all.
I'm having a similar issue but mine is the model is null when I inject in into my service.
This is my context:
injector.mapSingleton(GameModel); injector.mapSingleton(FacebookService);Then in the constructor I try to access the injected GameModel. Should I override a function my service what extends actor like the onRegister() in a Mediator?
Thanks!
Support Staff 5 Posted by Shaun Smith on 17 Nov, 2010 10:44 PM
https://github.com/robotlegs/robotlegs-framework/wiki/common-proble...
6 Posted by Thomas Gillis on 17 Nov, 2010 11:58 PM
Thank you Mr.Smith for helping this poor noob solve his problem! Worked like a charm and the page has been bookmarked for future reference :)
Stray closed this discussion on 13 Feb, 2011 03:14 PM.