MapSingleton, MapClass of Robotlegs not recognised in Haxe




I am stuck at a very crucial point and seems like a dead end for me.
I have got many robotlegs mappings in my as3 code like :

m_context.contextInjector.mapClass(test, test1);
m_context.contextInjector.mapClass(test2, test3);

contextInjector above returns IInjector.
In as3 everything works fine, but in Haxe i get the following error.

Error : IInjector has no field mapSingleton
Same error for mapClass : IInjector has no field mapClass

Haxe does not recognise mapSingleton, mapClass etc… PLEASE HELP



Awaiting your kind response at the earliest. Thanks


maybe @mayakwd can give you an answer, I know he uses Robotlegs.

Do you use the last haxe-robotlegs lib?



Robotlegs for haxe based on second version of robotlegs: returns InjectionMapping you could check it’s code with comments.

I recommend you to start reading documentation from here.



Thanks. But now I am getting the same type of error for mapClass, mapView, mapEvent etc.

This is the code :
m_context.contextInjector.mapClass(ClassA, ClassB);

Error :
robotlegs.bender.framework.api.IInjector has no field mapClass

same for mapView, mapEvent etc :
m_context.contextMediatorMap.mapView(View1, Mediator1);
m_context.contextCommandMap.mapEvent(Event1, Command1, Event2);



Any suggestions… ?


You could use same structure:

imports ...;

class Main {
  private var context:IContext;

  public static function main() {
    _context = new Context()
      .configure(new ContextView(this));

class ApplicationConfig implements IConfig {
  @inject public var mediatorMap:IMediatorMap;
  @inject public var commandMap:IEventCommandMap;

  public function configure() {;;