Wednesday, October 16, 2013

When there are more AMD modules defined than assigned to variables...

...like so:

define([
   "dojo/data/ItemFileReadStore",
   "dojo/_base/lang",
   "dojo/_base/declare",
   "dojox/mobile/ListItem",
   "lib/moment",
   "dojox/mobile/EdgeToEdgeDataList",
   "dojox/mobile/LongListMixin",
   "dojox/mobile/FilteredListMixin"
], function (
   ItemFileReadStore,
   lang,
   declare,
   ListItem,
   moment
) {

 
 

Well, if there are x variables then these are filled by the first x defines. Note, one does not strictly have to hand "lib/moment" to "moment" to use "moment" but my teammates tell me it is better to do so.

No comments:

Post a Comment