AnsweredAssumed Answered

Call custom modules within modules

Question asked by btfou on Oct 21, 2013
Latest reply on Oct 26, 2013 by btfou
I have two modules in a folder called "mods", which is loaded as a package with dojoConfig.  I require ModuleA in ModuleB, and it loads.  But I can't use it as a variable of the define function, only by a legacy call (see code).  If I require ModuleA in the application I can use it normally.  Am I missing something?  Any help is appreciated.

ModuleA:
define([  'dojo/_base/declare' ], function (declare) {   return declare('mods.ModuleA', [], {     //create module   }); });


ModuleB:
define([  'dojo/_base/declare',  'mods/ModuleA' ], function (declare, ModuleA) {   return declare([], {     //create module          createA: function() {              console.log(ModuleA); //returns an interger?!?!              console.log(mods.ModuleA); //returns module function()              /*       this.container.addChild(new ModuleA({a: 1, b: 'hi'}));       // throws an error because ModuleA = some integer       */              this.container.addChild(new mods.ModuleA({a: 1, b: 'hi'})); //legacy works?!?!            }        }); });

Outcomes