Select to view content in your preferred language

AMD Module Require and Legacy Module Require DOJO code

897
3
Jump to solution
11-25-2013 02:07 AM
SaqibAmin1
Emerging Contributor
Can AMD Module Require code be used with Legacy Module Require Code, or do you need to convert AMD to Legacy or vice versa?
0 Kudos
1 Solution

Accepted Solutions
JeffPace
MVP Alum
you can mix and match while you are migrating code.

One thing of note, you can not set

async:true in dojoConfig

Until you are completely migrated.

View solution in original post

0 Kudos
3 Replies
JeffPace
MVP Alum
you can mix and match while you are migrating code.

One thing of note, you can not set

async:true in dojoConfig

Until you are completely migrated.
0 Kudos
SaqibAmin1
Emerging Contributor
Thanks for your reply Jeff, just another basic question, in Legacy code where a dojo.require declaration is made, e.g. dojo.require("esri.map"); If I have the legacy dojo.require in one js file and in my AMD migration js file I have require(["esri/map",.....], function()....) is it ok to have two calls like this to esri.map, since both js files are serving one site.

In the AMD the esri.map object is only available to the function, whereas when it is globally declared in the dojo.require(), this is global to my application??

In my project the two calls work simultaneously, I am trying to find out the best working method and so that I stick to the standard way of doing things.
0 Kudos
JeffPace
MVP Alum
you may have to make duplicate calls until you migrate everything over.
0 Kudos