![what is the different between videoscribe version 2.2.4 and version2.3.0 what is the different between videoscribe version 2.2.4 and version2.3.0](http://3.bp.blogspot.com/-Li0vMlKja3k/VaHHdzeIs_I/AAAAAAAABPc/y4oFBEt4IiE/s400/appzdam%2Baf5649815218%2B95689985.png)
The recommended pattern for usage of define() is to have define's callback function return the value returned by declare. Once those dependencies are loaded, they are passed to a callback function. Instead of using dojo.require() to load dependencies, dependencies are specified as an array passed to define. This is how the modules in the examples below are created. For instance, using the same file structure as used in the Writing a Class tutorial, the module name for EmptyLayer would be "extras/EmptyLayer". If define is not passed a string as the first argument, the module identifier will be built using the module's path and file name. Before talking more about dojo/_base/declare, let's look at class names/module identifiers.Ĭlass names can still be explicitly created using the first argument passed to define, but this is optional.
WHAT IS THE DIFFERENT BETWEEN VIDEOSCRIBE VERSION 2.2.4 AND VERSION2.3.0 CODE
This is illustrated in the AMD code used below in the two examples. While there are multiple ways to create modules with define(), to mimick the classes in the Writing a Class tutorial, it is recommended to include dojo/_base/declare as a dependency of a module and return the value of calling declare(). Instead, modules are created by calling define(). Modules no longer begin with dojo.provide. To begin, let's look at module definitions. To create and use AMD style modules, changes need to occur both in the JavaScript file(s) that define modules as well as in the application JavaScript that loads modules. Rather than re-hash those points, this page will stick to the specifics in writing AMD style code versus the older clare style. The benefits of using AMD are outlined on the github page linked above as well as in the Dojo tutorial on defining modules. For more general information on AMD, refer to the AMD API page on Github.Īs of version 3.4 of the ArcGIS API for JavaScript, all Esri modules are written in the AMD style using define() and dojo/_base/declare. It is up to the developer to choose which style to use, but for new applications, developers should use AMD as the older style will not work with Dojo 2.0 and beyond. The older style of using dojo.provide(), dojo.require() and clare() is still supported as well. The ArcGIS API for JavaScript is built using Dojo, which fully supports creating classes and modules using Asynchronous Module Definition (AMD) style code. Dojo and Asynchronous Module Definition(AMD)