Hello,
I have one question regarding creation of objects in a JavaScript Application in a modular development.
If I create any object, for example esri/map object one one AMD module, how to access it on some other module. Let's assume that in a HTML page, when a dom is ready, I call some some method from a module to create a map as below;
define(["esri/map",
"dojo/on"], function (Map) {
return {
createMap: function (mapDivID) {
var map = new Map(mapDivID);
}, //createMap ends
};
});Now, I call this function from my HTML page when the DOM is ready. However, I'm not being able to figure out how to access this map variable (map object) on another AMD module. I guess I need to save it globally but How?
Any help is much appreciated.
Cheers,
S.