Skip to content

Instantly share code, notes, and snippets.

@jgravois
Last active December 24, 2015 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgravois/6802432 to your computer and use it in GitHub Desktop.
Save jgravois/6802432 to your computer and use it in GitHub Desktop.
anatomy of AMD module loading
require([
"esri/map", "esri/InfoTemplate", "esri/layers/FeatureLayer",
"dojo/parser", "dojo/domReady!"
], function( //Beginning of anonymous callback which fires when modules have been loaded.
Map, InfoTemplate, FeatureLayer,
parser //Variable names to refer to loaded modules
) {
parser.parse(); //first line of actual callback code
map = new Map("mapDiv", {
basemap: "national-geographic",
center: [-96.541, 38.34],
zoom: 6
});
...
}) //close out the anonymous callback function and require method's parenthesis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment