...
The syntax for loading this module are is pretty straight-forward as well. In this example we need to have Utils loaded before making a call to it. You'll note that we can use the Utils object because it's returned from the define and passed in as the argument for the require callback. This sort of encapsulation is highly encouraged by the AMD pattern.
...
Code Block | ||||
---|---|---|---|---|
| ||||
define("ModuleA", ["Utils", "ModuleB"], function(Utils, ModuleB){ ... }); |
In practice we omit the module name from our script files as the system will infer the module name based on how the script is loaded.
Tying together AMD and Platform Plugins
...