Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified require tag to be AMD compliant
Converted the legacy <require> tag to produce a <script> tag filled-in with AMD style requires, along with a callback closure containing parameters named after the required modules. e.g. <require modules="['dijit/form/Form', 'dijit/form/ValidationTextBox']"> console.debug("I'm in the callback"); </require> will produce : require(['dijit/form/Form', 'dijit/form/ValidationTextBox'], function(Form, ValidationTextBox) { console.debug("I'm in the callback"); }); The tag now accepts contents in its body, which will be the body of the callback. The callback parameter names can be overridden by the tag parameter "callbackParamNames". e.g. <require modules="['dijit/form/Form', 'dijit/form/ValidationTextBox']" callbackParamNames="['dijitForm','vtb']"> console.debug("I'm in the callback"); </require> will produce : require(['dijit/form/Form', 'dijit/form/ValidationTextBox'], function(dijitForm,vtb) { console.debug("I'm in the callback"); }); Note : It is deprecated to use global namespaces like dojo or digit in dojo 1.7+ applications.
- Loading branch information