esri/config questions

1887
0
10-22-2015 09:30 AM
TyroneBiggums
Occasional Contributor III

Hi,

I'm trying to wrap my head around how the esri/config class works. I noticed a module in our application that sets a esriConfig.defaults.map property but esri/config is not required in that module. I put a breakpoint on my first line of javascript once the DOM is ready to watch esriConfig. The default properties of esriConfig are set but I haven't explicitly required the class anywhere.

To confirm that I wasn't requiring the class elsewhere and it somehow being in scope, I went to the other module or two that were requiring esri/config and removed the reference. Surely, esriConfig would be undefined now, right? Nope, the default properties exist.

I review the documentation and discover this: "When coding legacy (non-AMD) style, there is no need to require the module. All methods and properties are available in the namespace." https://developers.arcgis.com/javascript/jsapi/esri.config-amd.html

I'm using 3.14 and AMDs. So, it would seem that I would have to require it.

Should esriConfig be required before setting/getting properties in a custom module?

How is esriConfig global?

Is esriConfig supposed to be global?

Should it be global?

Am I doing it wrong?

Why does the documentation imply that only legacy code requires requiring of esri/config?

Are there any other global classes?

Thank you,

D

0 Kudos
0 Replies